/// <summary> /// Ctor. /// </summary> /// <param name="dispatchService">for performing the dispatch</param> /// <param name="msecTimeout">timeout for preserving dispatch order through blocking</param> /// <param name="statementResultServiceImpl">handles result delivery</param> /// <param name="eventType">event type</param> public UpdateDispatchViewBlockingWait( EventType eventType, StatementResultService statementResultServiceImpl, DispatchService dispatchService, long msecTimeout) : base(eventType, statementResultServiceImpl, dispatchService) { currentFutureWait = new UpdateDispatchFutureWait(); // use a completed future as a start this.msecTimeout = msecTimeout; }
public override void NewResult(UniformPair<EventBean[]> results) { var dispatchTLEntry = statementResultService.DispatchTL.GetOrCreate(); statementResultService.Indicate(results, dispatchTLEntry); if (!dispatchTLEntry.IsDispatchWaiting) { UpdateDispatchFutureWait nextFutureWait; lock (this) { nextFutureWait = new UpdateDispatchFutureWait(this, currentFutureWait, msecTimeout); currentFutureWait.SetLater(nextFutureWait); currentFutureWait = nextFutureWait; } dispatchService.AddExternal(nextFutureWait); dispatchTLEntry.IsDispatchWaiting = true; } }
/// <summary>Ctor. </summary> /// <param name="view">is the blocking dispatch view through which to execute a dispatch</param> /// <param name="earlier">is the older future</param> /// <param name="msecTimeout">is the timeout period to wait for listeners to complete a prior dispatch</param> public UpdateDispatchFutureWait(UpdateDispatchViewBlockingWait view, UpdateDispatchFutureWait earlier, long msecTimeout) { _view = view; _earlier = earlier; _msecTimeout = msecTimeout; }