Skip to content

IConnectableWorkloadAdapter

Namespace: Hex1b

Assembly: Hex1b.dll

Optional capability marker for implementations whose output cannot start until an asynchronous "connected" milestone is reached (e.g. an HMP1 handshake completes, a WebSocket opens, a remote stream is negotiated).

csharp
public interface IConnectableWorkloadAdapter

Properties

ConnectedTask

Completes when the workload's connect / handshake step has finished and it is ready to emit output. Never faults — connect failures should still leave this task pending so callers can rely on for the disconnect path.

Returns: Task

csharp
Task ConnectedTask { get; }

DisconnectedTask

Completes when the workload has disconnected (transport closed, remote hung up, or local disposal). Never faults.

Returns: Task

csharp
Task DisconnectedTask { get; }

IsConnected

True after has completed and the transport has not yet disconnected.

Returns: Boolean

csharp
bool IsConnected { get; }

Remarks

Used by and the WithPlaceholderWorkload family of builder extensions to determine when to swap from a placeholder workload to the real primary.

A workload that is ready to produce output as soon as it is constructed (a child process, a Hex1bApp, an Asciinema file) does not need to implement this interface — the placeholder adapter will treat such workloads as connected on the first non-empty return.

Released under the MIT License.