Пример #1
0
        /// <summary>
        /// Starts R host process.
        /// </summary>
        /// <param name="callback">
        /// A set of callbacks that are called when R engine requests certain operation
        /// that are usually provided by the application
        /// </param>
        /// <param name="workingDirectory">R working directory</param>
        /// <param name="codePage">R code page to set</param>
        /// <param name="timeout">Timeout to wait for the host process to start</param>
        /// <param name="cancellationToken">Cancellation token</param>
        /// <exception cref="OperationCanceledException" />
        /// <exception cref="RHostDisconnectedException" />
        public Task StartHostAsync(IRHostSessionCallback callback, string workingDirectory = null, int codePage = 0, int timeout = 3000, CancellationToken cancellationToken = default(CancellationToken))
        {
            _userSessionCallback = callback;
            _rSessionCallback    = new RSessionCallback(_userSessionCallback);
            var startupInfo = new RHostStartupInfo(null, workingDirectory, codePage, isInteractive: true);

            return(_session.StartHostAsync(startupInfo, _rSessionCallback, timeout, cancellationToken));
        }
Пример #2
0
        public RManager(IRHostSessionCallback rhostSession)
        {
            //logger = loggerFacade;
            rHostSessionCallback = rhostSession;
            //eventAggregator = evtAggregator;

            WindowsDirectory = Path.GetTempPath();
        }
Пример #3
0
 public async Task StartHostAsync(IRHostSessionCallback rHostSessionCallback)
 {
     await rHostSession.StartHostAsync(rHostSessionCallback);
 }
Пример #4
0
 public RSessionApiTest()
 {
     _callback = Substitute.For <IRHostSessionCallback>();
     _session  = RHostSession.Create(nameof(RSessionApiTest));
 }
Пример #5
0
 public RSessionCallback(IRHostSessionCallback cb)
 {
     _cb = cb;
 }
Пример #6
0
 public RManager(IRHostSessionCallback rhostSession, ILoggerFacade loggerFacade, IROperations rOps)
 {
     //logger = loggerFacade;
     rHostSessionCallback = rhostSession;
     rOperations          = rOps;
 }