Skip to content

RelaySubscription

Defined in: relay-sdks/ts/src/subscription.ts:138

The handle RelaySubscriber.subscribe() returns: the core handle plus readiness and termination.

readonly ended: Promise<SubscriptionEnd>;

Defined in: relay-sdks/ts/src/subscription.ts:152

Settles once, when the subscription can no longer deliver, with how it ended. Never rejects. Publisher completion (onPublisherDone) is not an ending: trailing objects can still arrive, and the request stays open until cancel() or the connection ends. Neither awaitable implies exactly-once or gap-free delivery.


readonly requestId: number;

Defined in: relay-sdks/ts/packages/moq-core/dist/protocol/session.d.ts:116

Request ID of the SUBSCRIBE.

Subscription.requestId


readonly subscribed: Promise<SubscribeOk>;

Defined in: relay-sdks/ts/src/subscription.ts:145

Settles when the relay answers. Resolves with the acceptance info onSubscribed receives. Rejects with SubscriptionRequestError when the relay rejected the request or it timed out, SubscriptionConnectionClosedError when the connection ended first, or the reason given to cancel() (a CLOSED RelayError when none was given). Never rejects after acceptance.

cancel(reason?): void;

Defined in: relay-sdks/ts/packages/moq-core/dist/protocol/session.d.ts:120

Tear the subscription down. MOQT has no UNSUBSCRIBE message — teardown is the request stream’s lifecycle (§6.4.2.3).

Parameter Type
reason? unknown

void

Subscription.cancel


update(parameters): void;

Defined in: relay-sdks/ts/packages/moq-core/dist/protocol/session.d.ts:118

Modify the subscription (REQUEST_UPDATE, §9.5).

Parameter Type
parameters MessageParameters

void

Subscription.update