protected override void OnNotifyPrimarySendResult(string path, bool success) { IOThreadTimer oThreadTimer; if (success) { if (this.primaryFailureTimers.TryRemove(path, out oThreadTimer)) { oThreadTimer.Cancel(); return; } } else if (!this.primaryFailureTimers.ContainsKey(path)) { Tuple <SendAvailabilityPairedNamespaceOptions, string> tuple = new Tuple <SendAvailabilityPairedNamespaceOptions, string>(this, path); if (base.FailoverInterval == TimeSpan.Zero) { SendAvailabilityPairedNamespaceOptions.OnPrimaryFailedIntervalExpired(tuple); return; } IOThreadTimer oThreadTimer1 = new IOThreadTimer(new Action <object>(SendAvailabilityPairedNamespaceOptions.OnPrimaryFailedIntervalExpired), tuple, false); if (this.primaryFailureTimers.TryAdd(path, oThreadTimer1)) { oThreadTimer1.Set(base.FailoverInterval); } } }
public SendAvailabilityMessagePump(SendAvailabilityPairedNamespaceOptions options) { if (options == null) { throw Fx.Exception.AsError(new ArgumentNullException("options"), null); } if (options.PrimaryMessagingFactory == null) { throw Fx.Exception.AsError(new ArgumentNullException("options.PrimaryMessagingFactory"), null); } if (options.SecondaryMessagingFactory == null) { throw Fx.Exception.AsError(new ArgumentNullException("options.MessagingFactory"), null); } this.options = options; this.InstanceTrackingContext = TrackingContext.GetInstance(Guid.NewGuid(), this.options.SbNamespace); this.SyphonId = SendAvailabilityMessagePump.NextSyphonId(); this.timers = new IOThreadTimer[this.options.BacklogQueueCount]; this.queuesInProcess = new IAsyncResult[this.options.BacklogQueueCount]; }
public StartAsyncResult(SendAvailabilityPairedNamespaceOptions options, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state) { this.options = options; base.Start(); }
public SendAvailabilityPairedNamespaceFactory(SendAvailabilityPairedNamespaceOptions options) { this.options = options; }
public PingAsyncResult(SendAvailabilityPairedNamespaceOptions options, string path, TimeSpan timeout, AsyncCallback callback, object state) : base(timeout, callback, state) { this.options = options; this.path = path; }