Exemplo n.º 1
0
        /// <summary>
        /// This method adds a command initiator to the Microservice incoming channel.
        /// </summary>
        /// <typeparam name="C">The pipeline type.</typeparam>
        /// <param name="cpipe">The incoming channel pipeline.</param>
        /// <param name="command">The command initiator output.</param>
        /// <param name="startupPriority">The start up priority. The default is 90.</param>
        /// <param name="defaultRequestTimespan">The default request timespan.</param>
        /// <returns>The pipeline.</returns>
        public static C AttachICommandInitiator <C>(this C cpipe
                                                    , out ICommandInitiator command
                                                    , int startupPriority             = 90
                                                    , TimeSpan?defaultRequestTimespan = null
                                                    )
            where C : IPipelineChannelIncoming <IPipeline>
        {
            cpipe.Pipeline.AddICommandInitiator(out command
                                                , startupPriority, defaultRequestTimespan, cpipe);

            return(cpipe);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method adds a command initiator to the Microservice.
        /// </summary>
        /// <typeparam name="P">The pipeline type.</typeparam>
        /// <param name="pipeline">The pipeline.</param>
        /// <param name="command">The command initiator output.</param>
        /// <param name="startupPriority">The start up priority. The default is 90.</param>
        /// <param name="defaultRequestTimespan">The default request timespan.</param>
        /// <param name="responseChannel">The incoming channel to attach the command initiator to.</param>
        /// <param name="createChannel">This property specifies that the method should create a readonly channel just for the command initiator if the responseChannel is not found.</param>
        /// <returns>The pipeline.</returns>
        public static P AddICommandInitiator <P>(this P pipeline
                                                 , out ICommandInitiator command
                                                 , int startupPriority             = 90
                                                 , TimeSpan?defaultRequestTimespan = null
                                                 , string responseChannel          = null
                                                 , bool createChannel = true
                                                 )
            where P : IPipeline
        {
            CommandInitiator interim;

            pipeline.AddCommandInitiator(out interim, startupPriority, defaultRequestTimespan, responseChannel, createChannel);
            command = interim;
            return(pipeline);
        }
Exemplo n.º 3
0
        /// <summary>
        /// This method adds a command initiator to the Microservice.
        /// </summary>
        /// <typeparam name="P">The pipeline type.</typeparam>
        /// <param name="pipeline">The pipeline.</param>
        /// <param name="command">The command initiator output.</param>
        /// <param name="startupPriority">The start up priority. The default is 90.</param>
        /// <param name="defaultRequestTimespan">The default request timespan.</param>
        /// <param name="channelIncoming">The incoming channel to attach the command initiator to.</param>
        /// <returns>The pipeline.</returns>
        public static P AddICommandInitiator <P>(this P pipeline
                                                 , out ICommandInitiator command
                                                 , int startupPriority             = 90
                                                 , TimeSpan?defaultRequestTimespan = null
                                                 , IPipelineChannelIncoming <P> channelIncoming = null
                                                 )
            where P : IPipeline
        {
            var commandActual = new CommandInitiator(defaultRequestTimespan)
            {
                ResponseChannelId = channelIncoming.Channel.Id
            };

            command = commandActual;
            return(pipeline.AddCommand(commandActual, startupPriority));
        }