示例#1
0
        public void AddChannel(Fiber fiber, Func <Fiber, Channel <TChannel> > channelFactory)
        {
            _builder.AddChannel(fiber, x =>
            {
                Channel <TChannel> channel = channelFactory(new SynchronousFiber());

                return(new LastChannel <TChannel>(fiber, channel));
            });
        }
        public void AddChannel(Fiber fiber, Func <Fiber, Channel <TChannel> > channelFactory)
        {
            _builder.AddChannel(fiber, x =>
            {
                Channel <TChannel> channel = channelFactory(new SynchronousFiber());

                return(new SynchronizedChannel <TChannel>(fiber, channel, _synchronizationContext, _state));
            });
        }
示例#3
0
        public void AddChannel(Fiber fiber, Func <Fiber, Channel <IDictionary <TKey, TChannel> > > channelFactory)
        {
            _builder.AddChannel(fiber, x =>
            {
                Channel <IDictionary <TKey, TChannel> > channel = channelFactory(new SynchronousFiber());

                return(new DistinctChannel <TChannel, TKey>(fiber, _keyAccessor, channel));
            });
        }
示例#4
0
        public void AddChannel(Fiber fiber, Func <Fiber, Channel <ICollection <TChannel> > > channelFactory)
        {
            _builder.AddChannel(fiber, x =>
            {
                Channel <ICollection <TChannel> > channel = channelFactory(fiber);

                Fiber intervalFiber = _fiberFactory();
                Scheduler scheduler = _schedulerFactory();

                return(new IntervalChannel <TChannel>(intervalFiber, scheduler, _interval, channel));
            });
        }
示例#5
0
        public void Configure(ChannelBuilder <TChannel> builder)
        {
            FiberFactory fiberFactory = GetConfiguredFiberFactory();

            builder.AddChannel(fiberFactory(), fiber => new SelectiveConsumerChannel <TChannel>(fiber, _consumer));
        }
        public void Configure(ChannelBuilder <TChannel> builder)
        {
            Fiber fiber = GetConfiguredFiber(builder);

            builder.AddChannel(fiber, x => new ConsumerChannel <TChannel>(x, _consumer));
        }