//methods public virtual bool Execute(SignalWrapper <SignalDispatch <TKey> > item) { //find Dispatcher by deliveryType IDispatchChannel <TKey> channel = _channelRegistry.Match(item.Signal); if (channel == null) { _dispatchQueue.ApplyResult(item, ProcessingResult.NoHandlerFound); return(false); } //send with dispatcher ProcessingResult sendResult = ProcessingResult.Fail; Stopwatch sendTimer = Stopwatch.StartNew(); try { sendResult = channel.Send(item.Signal); } catch (Exception ex) { _logger.LogError(ex, null); } sendTimer.Stop(); //check dispatcher availability DispatcherAvailability availability = CheckAvailability(channel, sendResult); if (sendResult == ProcessingResult.Fail && availability == DispatcherAvailability.NotAvailable) { sendResult = ProcessingResult.Repeat; } _monitor.DispatchSent(item.Signal, sendResult, sendTimer.Elapsed); channel.CountSendAttempt(item.Signal, sendResult, availability); _dispatchQueue.ApplyResult(item, sendResult); return(sendResult == ProcessingResult.Success); }