Microsoft.R.Host.Client.Test.Script.RHostScript.InitializeAsync C# (CSharp) Method

InitializeAsync() public method

public InitializeAsync ( IRSessionCallback clientApp = null ) : Task
clientApp IRSessionCallback
return Task
        public async Task InitializeAsync(IRSessionCallback clientApp = null) {
            _clientApp = clientApp ?? _clientApp;

            Session = SessionProvider.GetOrCreate(SessionGuids.InteractiveWindowRSessionGuid);
            if (Session.IsHostRunning) {
                await Session.StopHostAsync();
            }

            await Session.StartHostAsync(new RHostStartupInfo {
                Name = "RHostScript",
                CranMirrorName = RToolsSettings.Current.CranMirror,
                CodePage = RToolsSettings.Current.RCodePage,
                RHostCommandLineArguments = RToolsSettings.Current.LastActiveConnection.RCommandLineArguments
            }, _clientApp ?? new RHostClientTestApp(), 50000);
        }