Skip to content

SupervisedPublisher

Defined in: relay-sdks/ts/src/supervised-publisher.ts:78

A publisher that reconnects. Create one with connectSupervisedPublisher. Each connection is a new generation with its own namespace; tracks are registered once and rebound to every generation.

readonly closed: Promise<{
error?: unknown;
}>;

Defined in: relay-sdks/ts/src/supervised-publisher.ts:92

Resolves once the supervisor stops: close(), the signal, or a failure it does not retry. Never rejects.


readonly generation:
| PublisherGeneration
| undefined;

Defined in: relay-sdks/ts/src/supervised-publisher.ts:80

The live generation, or undefined between connections and after closing.


readonly status: SupervisedStatus;

Defined in: relay-sdks/ts/src/supervised-publisher.ts:82

Where the supervisor stands; see SupervisedStatus.

close(): Promise<void>;

Defined in: relay-sdks/ts/src/supervised-publisher.ts:104

Stop reconnecting and close the live generation as RelayPublisher.close() does. Idempotent.

Promise<void>


registerTrack(options): RelayTrackWriter;

Defined in: relay-sdks/ts/src/supervised-publisher.ts:90

Register a track every generation serves, and return the writer that outlives the generations. The same rules as RelayPublisher.registerTrack, checked at once: track names are unique per supervised publisher, including after their writer closes. Writes wait for demand on the live generation; while none is up they fail with RECONNECTING, and an operation the connection’s end interrupts fails with RECONNECTING too, never CLOSED, so a frame writer treats it as an interruption and resumes at the next keyframe.

Parameter Type
options RegisterTrackOptions

RelayTrackWriter


rotate(): void;

Defined in: relay-sdks/ts/src/supervised-publisher.ts:102

Replace the live generation make-before-break, as happens on its own rotateBeforeMs before the credential expires: the next generation connects, with a fresh token, and every track is registered on it. Each track’s writer then moves to it at its next write or group, once the track has demand there or has none on the old one. The old generation closes once every track has moved, after 10 seconds at most. A no-op while no generation is up.

void