Пример #1
0
        public void Subscribe <T>(TimeSpan interval, MessageConsumer <IList <T> > consumer)
            where T : class
        {
            Pipe segment = PipeSegment.IntervalConsumer(interval, consumer);

            var binder = new SubscriberBinder(segment);

            binder.Bind(_pipe);

            _disposables.Add(segment);
        }
Пример #2
0
        public void Subscribe <T>(MessageConsumer <T> consumer)
            where T : class
        {
            Pipe segment = PipeSegment.Consumer(consumer);

            var binder = new SubscriberBinder(segment);

            binder.Bind(_pipe);

            _disposables.Add(segment);
        }
Пример #3
0
        // ReSharper disable UnusedMember.Local
        private void SubscribeAsyncComponent <TConsumer, TMessage>(Func <TConsumer> getConsumer)
        // ReSharper restore UnusedMember.Local
            where TConsumer : IAsyncConsumer <TMessage>
            where TMessage : class
        {
            Pipe segment = PipeSegment.AsyncConsumer <TConsumer, TMessage>(getConsumer);

            var binder = new SubscriberBinder(segment);

            binder.Bind(_pipe);

            _disposables.Add(segment);
        }
Пример #4
0
        // ReSharper disable UnusedMember.Local
        private void SubscribeConsumer <TConsumer, TMessage>(TConsumer consumer)
        // ReSharper restore UnusedMember.Local
            where TConsumer : IConsumer <TMessage>
            where TMessage : class
        {
            Pipe segment = PipeSegment.Consumer <TConsumer, TMessage>(consumer);

            var binder = new SubscriberBinder(segment);

            binder.Bind(_pipe);

            _disposables.Add(segment);
        }