InitQueueAsync() public method

Initializes the connection to the queue.
public InitQueueAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
コード例 #1
0
        public async Task QueueMessageBatchAsync <T>(Guid streamGuid, string streamNamespace, IEnumerable <T> events, StreamSequenceToken token,
                                                     Dictionary <string, object> requestContext)
        {
            var queueId = _streamQueueMapper.GetQueueForStream(streamGuid, streamNamespace);
            RabbitMessageQueueDataManager queue;

            if (!Queues.TryGetValue(queueId, out queue))
            {
                var tmpQueue = new RabbitMessageQueueDataManager(queueId.ToString(), DeploymentId, DataConnectionString);
                await tmpQueue.InitQueueAsync();

                queue = Queues.GetOrAdd(queueId, tmpQueue);
            }
            var cloudMsg = RabbitMessageQueueBatchContainer.ToCloudQueueMessage(streamGuid, streamNamespace, events, requestContext);
            await queue.AddQueueMessage(cloudMsg);
        }
コード例 #2
0
 public Task Initialize(TimeSpan timeout)
 {
     return(_queue != null?_queue.InitQueueAsync() : TaskDone.Done);  // check in case we already shut it down.
 }