Skip to content

ProtocolClient

Namespace: E2E.Engine.Protocol

public static class ProtocolClient

The client half of the engine protocol: ConnectEngine(ConnectEngineOptions) turns an engine server into an ordinary engine handle, so the harness drives a server in another process, on another machine, or in another language exactly as it drives an engine in its own process. A handle opens three kinds of connection, mirroring where the harness calls an engine: a run connection per target from prepare to finish, a worker connection from init to dispose, and a doctor connection per target for e2e doctor’s one call. None shares state with another. Upstream’s engine/protocol/client.ts.

Inheritance: object

.NET-only holder name: C# has no free functions.

View source

public static EngineHandle ConnectEngine(ConnectEngineOptions options)

Connects to an engine server and returns it as an engine handle, the value a target’s engine takes. The handle is built from the manifest and checked by DefineEngine(EngineSpec), so a manifest is held to every rule an engine in this process is. Upstream’s connectEngine.

Parameters

Name Type Description
options ConnectEngineOptions

Returns: EngineHandle

public static EngineHandle ProtocolEngine(EngineHandle engine)

The engine as the harness drives it: over the protocol. A ConnectEngine(ConnectEngineOptions) handle already is; an engine in this process is served over LoopbackTransport, so every call crosses the wire format a remote engine would receive. Fixtures, the app check, and the declared secrets stay the engine’s own: they belong to the client half of any engine. One engine always gets the same client, so a handle two targets or two config loads share stays one instance. Upstream’s protocolEngine.

Parameters

Name Type Description
engine EngineHandle

Returns: EngineHandle