src/Workspaces/Remote/ServiceHub/Services/RemoteHostService.cs
/// <summary>
/// Remote API. Initializes ServiceHub process global state.
/// </summary>
Remote API. Initializes ServiceHub process global state.
Remote API . Initializes ServiceHub process global state .
public void InitializeGlobalState(string host, int uiCultureLCID, int cultureLCID, string? serializedSession, CancellationToken cancellationToken)
        {
            RunService(() =>
            {
                AssetStorage.Initialize(this);
                if (serializedSession != null)
                {
                    SetGlobalContext(uiCultureLCID, cultureLCID, serializedSession);
                }
                RoslynLogger.Log(FunctionId.RemoteHost_Connect, KeyValueLogMessage.Create(m =>
                {
                    m["Host"] = host;
                    m["InstanceId"] = InstanceId;
                }));
                if (serializedSession != null)
                {
                    Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal;
                }
            }, cancellationToken);
        }
public void InitializeGlobalState ( string host , int uiCultureLCID , int cultureLCID , string ? serializedSession , CancellationToken cancellationToken ) { RunService ( ( ) => { AssetStorage . Initialize ( this ) ; if ( serializedSession != null ) { SetGlobalContext ( uiCultureLCID , cultureLCID , serializedSession ) ; } RoslynLogger . Log ( FunctionId . RemoteHost_Connect , KeyValueLogMessage . Create ( m => { m [ " " ] = host ; m [ " " ] = InstanceId ; } ) ) ; if ( serializedSession != null ) { Process . GetCurrentProcess ( ) . PriorityClass = ProcessPriorityClass . BelowNormal ; } } , cancellationToken ) ; }
Remote API.
Remote API .
// initialize global asset storage // serializedSession may be null for testing // log telemetry that service hub started // Set this process's priority BelowNormal. // this should let us to freely try to use all resources possible without worrying about affecting // host's work such as responsiveness or build.
host
string
uiCultureLCID
int
cultureLCID
int
serializedSession
string?
cancellationToken
CancellationToken