public RetryBrowserAsyncResult(MessageBrowser browser, TrackingContext trackingContext, int messageCount, long fromSequenceNumber, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state) { this.browser = browser; this.messageCount = messageCount; this.fromSequenceNumber = fromSequenceNumber; this.trackingContext = trackingContext; }
internal IEnumerable <BrokeredMessage> PeekBatch(TrackingContext trackingContext, long fromSequenceNumber, int messageCount, TimeSpan timeout) { base.ThrowIfDisposed(); TimeoutHelper.ThrowIfNegativeArgument(timeout); if (trackingContext == null) { trackingContext = TrackingContext.GetInstance(Guid.NewGuid(), this.Path); } MessageBrowser.TracePeek(EventTraceActivity.CreateFromThread(), trackingContext); if (this.openOnceManager.ShouldOpen) { this.openOnceManager.Open(); } return(this.OnPeek(trackingContext, fromSequenceNumber, messageCount, timeout)); }
internal IAsyncResult BeginPeekBatch(TrackingContext trackingContext, long fromSequenceNumber, int messageCount, TimeSpan timeout, AsyncCallback callback, object state) { TrackingContext instance = trackingContext; base.ThrowIfDisposed(); TimeoutHelper.ThrowIfNegativeArgument(timeout); if (instance == null) { instance = TrackingContext.GetInstance(Guid.NewGuid(), this.Path); } MessageBrowser.TracePeek(EventTraceActivity.CreateFromThread(), instance); if (!this.openOnceManager.ShouldOpen) { MessageBrowser.RetryBrowserAsyncResult retryBrowserAsyncResult1 = new MessageBrowser.RetryBrowserAsyncResult(this, instance, messageCount, fromSequenceNumber, timeout, callback, state); retryBrowserAsyncResult1.Start(); return(retryBrowserAsyncResult1); } return(this.openOnceManager.Begin <IEnumerable <BrokeredMessage> >(callback, state, (AsyncCallback c, object s) => { MessageBrowser.RetryBrowserAsyncResult retryBrowserAsyncResult = new MessageBrowser.RetryBrowserAsyncResult(this, instance, messageCount, fromSequenceNumber, timeout, c, s); retryBrowserAsyncResult.Start(); return retryBrowserAsyncResult; }, new Func <IAsyncResult, IEnumerable <BrokeredMessage> >(MessageBrowser.RetryBrowserAsyncResult.End))); }
internal BrokeredMessage Peek(TrackingContext trackingContext, long fromSequenceNumber, TimeSpan timeout) { IEnumerable <BrokeredMessage> brokeredMessages = this.PeekBatch(trackingContext, fromSequenceNumber, 1, timeout); return(MessageBrowser.GetTopMessage(brokeredMessages)); }
public BrokeredMessage EndPeek(IAsyncResult result) { return(MessageBrowser.GetTopMessage(this.EndPeekBatch(result))); }