void TransformEventToObservable()
        {
            BusNotifications busNotifications = new BusNotifications();

            #region ConvertEventToObservable

            IObservable<EventPattern<FailedMessage>> failedMessages = Observable.FromEventPattern<EventHandler<FailedMessage>, FailedMessage>(
                handler => busNotifications.Errors.MessageSentToErrorQueue += handler, 
                handler => busNotifications.Errors.MessageSentToErrorQueue -= handler);

            IDisposable subscription = failedMessages
                .Subscribe(x => Console.WriteLine($"Message {x.EventArgs.MessageId} moved to error queue"));

            #endregion

        }
 public SubscribeToNotifications(BusNotifications busNotifications)
 {
     this.busNotifications = busNotifications;
 }
예제 #3
0
        public BehaviorChain(IEnumerable <Type> behaviorList, T context, PipelineExecutor pipelineExecutor, BusNotifications notifications)
        {
            context.SetChain(this);
            this.context       = context;
            this.notifications = notifications;
            foreach (var behaviorType in behaviorList)
            {
                itemDescriptors.Enqueue(behaviorType);
            }

            lookupSteps = pipelineExecutor.Incoming.Concat(pipelineExecutor.Outgoing).ToDictionary(rs => rs.BehaviorType);
        }