Exemplo n.º 1
0
        public async Task <IReadOnlyList <ICloudQueueMessage> > GetMessagesAsync(int messageCount)
        {
            var messages = await CloudEntity.GetMessagesAsync(messageCount);

            var result = new List <ICloudQueueMessage>(messageCount);

            result.AddRange(
                messages.Select(message =>
                                new CloudQueueMessageAdapter(
                                    message.Id,
                                    message.PopReceipt,
                                    message.DequeueCount,
                                    message.AsBytes)));

            return(result);
        }
Exemplo n.º 2
0
        public async Task <IReadOnlyList <ICloudQueueMessage> > GetMessagesAsync(int messageCount, TimeSpan visibilityTimeout)
        {
            var messages = await CloudEntity.GetMessagesAsync(
                messageCount,
                visibilityTimeout,
                null,
                null);

            var result = new List <ICloudQueueMessage>(CloudQueueMessage.MaxNumberOfMessagesToPeek);

            result.AddRange(
                messages.Select(message =>
                                new CloudQueueMessageAdapter(
                                    message.Id,
                                    message.PopReceipt,
                                    message.DequeueCount,
                                    message.AsBytes)));

            return(result);
        }