示例#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)));
            }
        }
        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));
        }
 public Task ProcessMessageAsync(AzureQueueMessage <T> token)
 {
     return(_queue.DeleteMessageAsync(token.Token));
 }
示例#4
0
 public Task ProcessMessageAsync(AzureQueueMessage <T> token)
 {
     return(Task.FromResult(0));
 }