Exemplo n.º 1
0
        protected ReactiveCommandHandler(Uri uri, Guid receiverId)
        {
            ReceiverId = receiverId;

            ServiceBus = ConfigureServiceBus(uri);

            _subscription = ServiceBus.AsObservable <T>()
                            .ObserveOn(NewThreadScheduler.Default)
                            .Where(cmd => cmd.ReceiverId.Equals(Guid.Empty) || cmd.ReceiverId.Equals(ReceiverId))
                            .Subscribe(
                HandleCommand,
                HandleException,
                HandleCompletion);
        }
Exemplo n.º 2
0
        protected DomainEventHandler(Uri uri, Guid receiverId)
        {
            ReceiverId = receiverId;

            ServiceBus = ConfigureServiceBus(uri);

            _subscription = ServiceBus.AsObservable <TEvent>()
                            .ObserveOn(NewThreadScheduler.Default)
                            .Where(ev => ev.ReceiverId.Equals(Guid.Empty) || ev.ReceiverId.Equals(ReceiverId))
                            .Subscribe(
                HandleEvent,
                HandleException,
                HandleCompletion);
        }