示例#1
0
        public Task <AzureQueueMessage <T> > GetMessageAsync()
        {
            lock (_queue){
                if (_queue.Count == 0)
                {
                    return(Task.FromResult(AzureQueueMessage <T> .Create(default(T), null)));
                }

                return(Task.FromResult(AzureQueueMessage <T> .Create(_queue.Dequeue(), null)));
            }
        }
示例#2
0
        public async Task <AzureQueueMessage <T> > GetMessageAsync()
        {
            var msg = await _queue.GetMessageAsync();

            if (msg == null)
            {
                return(null);
            }

            await _queue.DeleteMessageAsync(msg);

            return(AzureQueueMessage <T> .Create(Newtonsoft.Json.JsonConvert.DeserializeObject <T>(msg.AsString), msg));
        }
示例#3
0
 public Task ProcessMessageAsync(AzureQueueMessage <T> token)
 {
     return(_queue.DeleteMessageAsync(token.Token));
 }
示例#4
0
 public Task ProcessMessageAsync(AzureQueueMessage <T> token)
 {
     return(Task.FromResult(0));
 }