예제 #1
0
 public InteractiveLoop(IConsole console, IConsoleKeyHandler consoleKeyHandler, IConsoleWriter consoleWriter,
                        IReplEngine replEngine, ILoop loop, IConsoleState consoleState)
 {
     _console           = console;
     _consoleKeyHandler = consoleKeyHandler;
     _consoleWriter     = consoleWriter;
     _replEngine        = replEngine;
     _loop         = loop;
     _consoleState = consoleState;
 }
        public static ICollection <string> GetLocalVariables(this IReplEngine replEngine, string sessionKey,
                                                             ScriptPackSession scriptPackSession)
        {
            if (scriptPackSession != null && scriptPackSession.State.ContainsKey(sessionKey))
            {
                var sessionState = (SessionState <ScriptState>)scriptPackSession.State[sessionKey];
                return(sessionState.Session.Variables.Select(x => $"{x.Type} {x.Name}").Distinct().ToArray());
            }

            return(new string[0]);
        }
예제 #3
0
        /// <summary>
        /// Creates an instance of the controller.
        /// </summary>
        /// <param name="startupScript">The script to run at startup, default is null.</param>
        /// <param name="workingDirectory">The working directory, default is null.</param>
        /// <param name="replEngine">The REPL engine.</param>
        /// <param name="processService">Service for starting windows processes.</param>
        /// <param name="dispatcherScheduler">The Reactive extensions shceduler for the UI thread (dispatcher).</param>
        /// <param name="taskScheduler">The Reactive extensiosn scheduler for the task pool scheduler.</param>
        public ReplEngineController(string startupScript           = null,
                                    string workingDirectory        = null,
                                    IReplEngine replEngine         = null,
                                    IProcessService processService = null,
                                    IScheduler dispatcherScheduler = null,
                                    IScheduler taskScheduler       = null)
        {
            _startupScript  = startupScript;
            _processService = processService ?? new ProcessService();
            _disposable     = new CompositeDisposable();

            _replEngine          = replEngine ?? CreateEngine(workingDirectory);
            _dispatcherScheduler = dispatcherScheduler ?? DispatcherScheduler.Current;
            _taskPoolScheduler   = taskScheduler ?? TaskPoolScheduler.Default;
        }
        /// <summary>
        /// Creates an instance of the controller.
        /// </summary>
        /// <param name="startupScript">The script to run at startup, default is null.</param>
        /// <param name="workingDirectory">The working directory, default is null.</param>
        /// <param name="replEngine">The REPL engine.</param>
        /// <param name="processService">Service for starting windows processes.</param>
        /// <param name="dispatcherScheduler">The Reactive extensions shceduler for the UI thread (dispatcher).</param>
        /// <param name="taskScheduler">The Reactive extensiosn scheduler for the task pool scheduler.</param>
        public ReplEngineController(string startupScript = null,
            string workingDirectory = null,
            IReplEngine replEngine = null,
            IProcessService processService = null,
            IScheduler dispatcherScheduler = null,
            IScheduler taskScheduler = null)
        {
            _startupScript = startupScript;
            _processService = processService ?? new ProcessService();
            _disposable = new CompositeDisposable();

            _replEngine = replEngine ?? CreateEngine(workingDirectory);
            _dispatcherScheduler = dispatcherScheduler ?? DispatcherScheduler.Current;
            _taskPoolScheduler = taskScheduler ?? TaskPoolScheduler.Default;
        }
예제 #5
0
        public Session(ConnectionInformation connection, IReplEngine engine, ILogger logger)
        {
            _connection = connection;
            _engine     = engine;
            _logger     = logger;
            _validator  = new Validator(_logger, connection.Key, connection.SignatureScheme);
            _sender     = new MessageSender(_validator, _logger);

            InitializeMessageHandlers();

            _heartbeat = new Heartbeat(_logger, GetAddress(connection.HBPort));
            _shell     = new Shell(_logger, GetAddress(connection.ShellPort), GetAddress(connection.IOPubPort), _validator, MessageHandlers);

            _heartbeat.Start();
            _shell.Start();
        }
 public ExecuteRequestHandler(ILog logger, IReplEngine replEngine)
 {
     this.logger = logger;
     this.replEngine = replEngine;
 }
예제 #7
0
 public ExecuteRequestHandler(ILog logger, IReplEngine replEngine, IMessageSender messageSender)
 {
     this.logger        = logger;
     this.replEngine    = replEngine;
     this.messageSender = messageSender;
 }
예제 #8
0
 public ExecuteRequestHandler(ILog logger, IReplEngine replEngine)
 {
     this.logger     = logger;
     this.replEngine = replEngine;
 }
예제 #9
0
        public ExecuteRequestHandler(ILog logger, IReplEngine replEngine, IMessageSender messageSender)
        {
            this.logger = logger;
            this.replEngine = replEngine;
			this.messageSender = messageSender;
        }
예제 #10
0
 public ExecuteRequestHandler(ILogger logger, IReplEngine replEngine)
 {
     _logger     = logger;
     _replEngine = replEngine;
 }