Ejemplo n.º 1
0
        public void Subscribe <TEvent>(CourierSubscriptionBuilder <TEvent> builder)
            where TEvent : class, ICourierEvent
        {
            var subscriber = builder.BuildWithStream(Events);

            this.Subscribe(subscriber);
        }
Ejemplo n.º 2
0
        public void Subscribe <TEvent>(Action <TEvent> action)
            where TEvent : class, ICourierEvent
        {
            var subscription = new CourierSubscriptionBuilder <TEvent>().WithAction(action).BuildWithStream(Events);

            this.Subscribe(subscription);
        }
Ejemplo n.º 3
0
        public void Subscribe <TEvent, TEventListener>(Func <TEventListener> factoryAction)
            where TEvent : class, ICourierEvent
            where TEventListener : ICourierListener <TEvent>
        {
            var subscription = new CourierSubscriptionBuilder <TEvent>().FromFactoryAction(factoryAction).BuildWithStream(Events);

            this.Subscribe(subscription);
        }
Ejemplo n.º 4
0
        public void Subscribe <TEvent, TEventListener>(TEventListener instance)
            where TEvent : class, ICourierEvent
            where TEventListener : ICourierListener <TEvent>
        {
            var subscription = new CourierSubscriptionBuilder <TEvent>().FromListenerInstance(instance).BuildWithStream(Events);

            this.Subscribe(subscription);
        }