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); }
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); }