public static async Task <QueueManager <H, W> > CreateAsync(WorkManager <H, W> workManager)
            {
                // try to create from saved state
                IReliableDictionary <string, string> dictQueueNames =
                    await workManager.StateManager.GetOrAddAsync <IReliableDictionary <string, string> >(WorkManager <H, W> .s_Queue_Names_Dictionary);

                QueueManager <H, W> qManager = new QueueManager <H, W>(workManager);

                qManager.m_dictListOfQueues = dictQueueNames;


                foreach (KeyValuePair <string, string> kvp in dictQueueNames)
                {
                    // preload all refs
                    qManager.m_QueueRefs.TryAdd(kvp.Key, await workManager.StateManager.GetOrAddAsync <IReliableQueue <W> >(kvp.Key));
                    qManager.qOfq.Enqueue(kvp.Key);
                }


                return(qManager);
            }
Beispiel #2
0
 public WorkExecuter(WorkManager <Handler, Wi> workManager)
 {
     this.m_WorkManager = workManager;
 }
 private QueueManager(WorkManager <H, W> workManager)
 {
     this.m_WorkManager = workManager;
 }