Exemple #1
0
        private void ContinueOnTimeout(ReceptionContext <TMessage> receptionContext, DispatchContext <TMessage> dispatchContext)
        {
            if (!dispatchContext.OwnedCancellation.IsCancellationRequested)
            {
                lock (dispatchContext.Locker)
                {
                    if (!dispatchContext.OwnedCancellation.IsCancellationRequested)
                    {
                        foreach (var timeout in _timeoutHandlers)
                        {
                            try { timeout(dispatchContext); }
                            catch { }
                        }

                        dispatchContext.Dispose();
                        receptionContext.Timeout();
                    }
                }
            }
        }
Exemple #2
0
        private void ContinueOnSuccess(ReceptionContext <TMessage> receptionContext, DispatchContext <TMessage> dispatchContext)
        {
            if (!dispatchContext.OwnedCancellation.IsCancellationRequested)
            {
                lock (dispatchContext.Locker)
                {
                    if (!dispatchContext.OwnedCancellation.IsCancellationRequested)
                    {
                        foreach (var complete in _completeHandlers)
                        {
                            try { complete(dispatchContext); }
                            catch { }
                        }

                        dispatchContext.Dispose();
                        receptionContext.Success();
                    }
                }
            }
        }