Ejemplo n.º 1
0
        public IAsyncResult BeginAddMessage(CloudQueueMessage message, AsyncCallback callback, object state)
        {
            CloudQueue        queue   = _queues[GetNextQueue()];
            NestedAsyncHelper wrapper = NestedAsyncHelper.WrapBeginParameters(callback, state, queue);

            return(wrapper.WrapAsyncResult(queue.BeginAddMessage(message, NestedAsyncHelper.Callback, wrapper)));
        }
Ejemplo n.º 2
0
        public IEnumerable <CloudQueueMessage> EndGetMessages(IAsyncResult asyncResult)
        {
            CloudQueue queue = (CloudQueue)NestedAsyncHelper.GetExtraState(asyncResult);
            IEnumerable <CloudQueueMessage> msgs = queue.EndGetMessages(NestedAsyncHelper.UnwrapAsyncResult(asyncResult));

            return(msgs.Select(msg => HSMessageWrapper.FromCloudQueueMessage(msg, queue)));
        }
Ejemplo n.º 3
0
        public IAsyncResult BeginGetMessages(int messageCount, TimeSpan visibilityTimeout, AsyncCallback callback,
                                             object state)
        {
            CloudQueue        queue   = _queues[GetNextQueue()];
            NestedAsyncHelper wrapper = NestedAsyncHelper.WrapBeginParameters(callback, state, queue);

            return
                (wrapper.WrapAsyncResult(queue.BeginGetMessages(messageCount, visibilityTimeout,
                                                                NestedAsyncHelper.Callback, wrapper)));
        }
Ejemplo n.º 4
0
        public IAsyncResult BeginDeleteMessage(CloudQueueMessage message, AsyncCallback callback, object state)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            HSMessageWrapper  msg     = (HSMessageWrapper)message;
            NestedAsyncHelper wrapper = NestedAsyncHelper.WrapBeginParameters(callback, state, msg._origin);

            return(wrapper.WrapAsyncResult(msg._origin.BeginDeleteMessage(msg, NestedAsyncHelper.Callback, wrapper)));
        }
Ejemplo n.º 5
0
        public void EndDeleteMessage(IAsyncResult asyncResult)
        {
            CloudQueue queue = (CloudQueue)NestedAsyncHelper.GetExtraState(asyncResult);

            queue.EndDeleteMessage(NestedAsyncHelper.UnwrapAsyncResult(asyncResult));
        }