コード例 #1
0
        /// <summary>
        /// Add a consumer of the specified message type
        /// </summary>
        /// <typeparam name="TChannel">The channel type</typeparam>
        /// <returns>A chainable method to configure additional options</returns>
        public static ChannelConfigurator <TChannel> AddConsumerOf <TChannel>(this ConnectionConfigurator configurator)
        {
            var channelConfigurator = new ChannelConfiguratorImpl <TChannel>();

            configurator.AddConfigurator(channelConfigurator);

            return(channelConfigurator);
        }
コード例 #2
0
        /// <summary>
        /// Add a consumer to the channel using the message type defined for the channel
        /// </summary>
        /// <typeparam name="TChannel">The channel type, specifies the type of message sent by the channel</typeparam>
        /// <param name="connectionConfigurator">The connection configurator</param>
        /// <param name="consumer">The consumer to add to the channel</param>
        /// <returns>A consumer configurator to customize the consumer settings</returns>
        public static ConsumerConfigurator <TChannel> AddConsumer <TChannel>(
            this ConnectionConfigurator <TChannel> connectionConfigurator,
            Consumer <TChannel> consumer)
        {
            var channelConfigurator = new ChannelConfiguratorImpl <TChannel>();

            connectionConfigurator.AddConfigurator(channelConfigurator);

            return(channelConfigurator
                   .UsingConsumer(consumer));
        }
コード例 #3
0
        public static ConsumerConfigurator <T> AddChannel <T>(this ConnectionConfigurator <T> configurator,
                                                              UntypedChannel channel)
        {
            var channelConfigurator = new ChannelConfiguratorImpl <T>();

            configurator.AddConfigurator(channelConfigurator);

            var consumerConfigurator = new ConsumerConfiguratorImpl <T>(channel.Send);

            channelConfigurator.AddConfigurator(consumerConfigurator);

            return(consumerConfigurator);
        }
コード例 #4
0
        /// <summary>
        /// Add a consumer to the channel using the message type defined for the channel
        /// </summary>
        /// <typeparam name="TChannel">The channel type, specifies the type of message sent by the channel</typeparam>
        /// <param name="connectionConfigurator">The connection configurator</param>
        /// <param name="consumer">The consumer to add to the channel</param>
        /// <returns>A consumer configurator to customize the consumer settings</returns>
        public static ConsumerConfigurator <TChannel> AddSelectiveConsumer <TChannel>(
            this ConnectionConfigurator <TChannel> connectionConfigurator,
            SelectiveConsumer <TChannel> consumer)
        {
            var channelConfigurator = new ChannelConfiguratorImpl <TChannel>();

            connectionConfigurator.AddConfigurator(channelConfigurator);

            var consumerConfigurator = new SelectiveConsumerConfigurator <TChannel>(consumer);

            channelConfigurator.AddConfigurator(consumerConfigurator);

            return(consumerConfigurator);
        }