Nebula
Orchestrator

ProcessWorkerHost

Runs each worker as a child Unity process using the configured worker executable.

generated from the sources
public sealed class ProcessWorkerHost : IWorkerHost

Runs each worker as a child Unity process using the configured worker executable. This is the local mesh (nebula start) and the reference implementation of IWorkerHost. The orchestrator also uses it to start co-located services (the gateway) whatever host the workers use.

Constructors

ProcessWorkerHost

public ProcessWorkerHost(string executable, string advertiseAddress);
ParameterDescription
executableUnity player executable to run. Required by the standalone orchestrator.
advertiseAddressAddress child workers advertise to peers (127.0.0.1 on one machine).

Properties

Name

public string Name { get; }

IsReady

public bool IsReady { get; }

InitializationError

public string InitializationError { get; }

SupportsParking

public bool SupportsParking { get; }

A local process costs nothing while it is not running, so retiring one kills it and the idle pool stays empty.

TypicalBootSeconds

public float TypicalBootSeconds { get; }

A Unity player in batch mode is simulating a couple of seconds after it is started.

Methods

Park

public void Park(IWorkerHandle handle, float idlePoolSeconds);

Killing is how this host parks: a process is free to restart, so there is nothing to keep.

Unpark

public bool Unpark(IWorkerHandle handle);

Nothing is ever parked here, so there is never anything to bring back.

Initialize

public void Initialize(Action<string, string> log);

Launch

public IWorkerHandle Launch(WorkerLaunchSpec spec);

LaunchService

public Process LaunchService(string role, string roleArgs, string logName, string commonArgs);

Start a non-worker role (the gateway) next to the orchestrator. Returns null on failure.

Kill

public void Kill(IWorkerHandle handle);

KillProcess

public static void KillProcess(Process p);

SafePid

public static int SafePid(Process p);

HasExited

public static bool HasExited(Process p);

Tick

public void Tick();

WriteHandleJson

public void WriteHandleJson(IWorkerHandle handle, JsonWriter w);

Dispose

public void Dispose();

On this page