Esempio 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 AttachCommandInitiator <C>(this C cpipe
                                                   , out CommandInitiator command
                                                   , int startupPriority             = 90
                                                   , TimeSpan?defaultRequestTimespan = null
                                                   )
            where C : IPipelineChannelIncoming <IPipeline>
        {
            cpipe.Pipeline.AddCommandInitiator(out command
                                               , startupPriority, defaultRequestTimespan, cpipe);

            return(cpipe);
        }
Esempio 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 will create the channel.</param>
 /// <returns>The pipeline.</returns>
 public static P AddCommandInitiator <P>(this P pipeline
                                         , out CommandInitiator command
                                         , int startupPriority             = 90
                                         , TimeSpan?defaultRequestTimespan = null
                                         , string responseChannel          = null
                                         , bool createChannel = true
                                         )
     where P : IPipeline
 {
     command = new CommandInitiator(defaultRequestTimespan);
     command.ResponseChannelId = ValidateOrCreateOutgoingChannel(pipeline, responseChannel, command.ComponentId, createChannel);
     return(pipeline.AddCommand(command, startupPriority));
 }
Esempio 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 AddCommandInitiator <P>(this P pipeline
                                                , out CommandInitiator command
                                                , int startupPriority             = 90
                                                , TimeSpan?defaultRequestTimespan = null
                                                , IPipelineChannelIncoming <P> channelIncoming = null
                                                )
            where P : IPipeline
        {
            command = new CommandInitiator(defaultRequestTimespan)
            {
                ResponseChannelId = channelIncoming.Channel.Id
            };

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