예제 #1
0
        /// <summary>
        /// Internal initialization method to create all necessary members
        /// </summary>
        /// <param name="parent">The parent kernel manager that created us.</param>
        /// <param name="channelFactory">Factory used to create the various channels</param>
        /// <param name="autoStartChannels">If true, will automatically start the channels to the kernel</param>
        private void Initialize(IKernelManager parent, IChannelFactory channelFactory, bool autoStartChannels, ILogger logger)
        {
            this.Logger         = logger ?? new DefaultLogger();
            this.Parent         = parent;
            this.ClientSession  = new Session(Connection.Key);
            this.ExecuteLog     = new Dictionary <string, ExecutionEntry>();
            this.ChannelFactory = channelFactory ?? new ZMQChannelFactory(Connection, ClientSession, Logger);

            if (autoStartChannels)
            {
                StartChannels();
            }
        }
예제 #2
0
 public KernelClient(IKernelManager parent, IChannelFactory channelFactory, bool autoStartChannels = true, ILogger logger = null)
 {
     Initialize(parent, channelFactory, autoStartChannels, logger);
 }