Example #1
0
        public UserEventSubscriber(IEventQueue queue, IQueryStore store)
        {
            queue.Subscribe <UserRegistrationStarted>(Handle);
            queue.Subscribe <UserRegistrationSucceeded>(Handle);
            queue.Subscribe <UserRegistrationFailed>(Handle);

            _store = store;
        }
        public TransferEventSubscriber(IEventQueue queue, IQueryStore store, IQuerySearch search)
        {
            queue.Subscribe <TransferStarted>(Handle);
            queue.Subscribe <TransferUpdated>(Handle);
            queue.Subscribe <TransferCompleted>(Handle);

            _store  = store;
            _search = search;
        }
Example #3
0
        public PersonEventSubscriber(IEventQueue queue, IQueryStore store)
        {
            _store = store;

            queue.Subscribe <PersonBoxed>(Handle);
            queue.Subscribe <PersonRegistered>(Handle);
            queue.Subscribe <PersonRenamed>(Handle);
            queue.Subscribe <PersonUnboxed>(Handle);
        }
Example #4
0
        public UserRegistrationProcessManager(ICommandQueue commander, IEventQueue publisher, IQuerySearch querySearch)
        {
            _commander   = commander;
            _querySearch = querySearch;

            publisher.Subscribe <UserRegistrationStarted>(Handle);
            publisher.Subscribe <UserRegistrationSucceeded>(Handle);
            publisher.Subscribe <UserRegistrationFailed>(Handle);
        }
Example #5
0
        public TransferProcessManager(ICommandQueue commander, IEventQueue publisher, IEventRepository repository)
        {
            _commander  = commander;
            _repository = repository;

            publisher.Subscribe <TransferStarted>(Handle);
            publisher.Subscribe <MoneyDeposited>(Handle);
            publisher.Subscribe <MoneyWithdrawn>(Handle);
        }
        public AccountEventSubscriber(IEventQueue queue, IQueryStore store, IQuerySearch search)
        {
            queue.Subscribe <AccountOpened>(Handle);
            queue.Subscribe <AccountClosed>(Handle);
            queue.Subscribe <MoneyDeposited>(Handle);
            queue.Subscribe <MoneyWithdrawn>(Handle);

            _store  = store;
            _search = search;
        }
        public UmbrellaProcessManager(ICommandQueue commander, IEventQueue publisher, IQuerySearch querySearch)
        {
            _querySearch = querySearch;

            publisher.Subscribe <TransferStarted>(Handle);
            commander.Override <RenamePerson>(Handle, Tenants.Umbrella.Identifier);
        }
Example #8
0
 public IDisposable Subscribe(Action <T> handler)
 {
     return(queue.Subscribe <T>(evt => {
         if (filter(evt))
         {
             handler(evt);
         }
     }));
 }
        public LoaderService(IEventQueue queue, TimeSpan throttling, ILog log = null, ICache cache = null)
        {
            this.queue      = queue;
            this.throttling = throttling;
            this.log        = log;
            this.cache      = cache;

            eventSubscribtion = queue.Subscribe <LoadPageEvent>(LoadPage);
        }
 public CachingService(IEventQueue queue, ICache cache)
 {
     this.cache        = cache;
     this.subscribtion = queue.Subscribe <ContentLoadedEvent>(CacheItem);
 }