Skip to content

SubscriptionHandlers

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

Callbacks for MoqtSession.subscribe. Each must be synchronous; an async function throws TypeError.

onDone?(done): void;

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

PUBLISH_DONE arrived. Subgroup streams already in flight still deliver until the subscription is cancelled.

Parameter Type
done PublishDone

void


onError?(error): void;

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

The subscription failed before or instead of SUBSCRIBE_OK: REQUEST_ERROR, or a stream failure.

Parameter Type
error RequestError

void


onGoaway?(goaway): void;

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

GOAWAY on this request stream: re-issue the request (possibly elsewhere).

Parameter Type
goaway Goaway

void


onObject?(object): void;

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

An object arrived on one of the subscription’s subgroup streams.

Parameter Type
object MoqtObject

void


onOk?(ok): void;

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

SUBSCRIBE_OK arrived.

Parameter Type
ok SubscribeOk

void


onStateNotify?(parameters): void;

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

PUBLISH_STATE_NOTIFY (§9.10): the publisher changed subscription state on its own — parameters carries only what changed, with LARGEST_OBJECT marking where. Informational; the session sends no reply.

Parameter Type
parameters MessageParameters

void


onSubgroupEnd?(info): void;

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

A subgroup stream finished cleanly (FIN).

Parameter Type
info { endOfGroup: boolean; groupId: number; subgroupId: number; }
info.endOfGroup boolean
info.groupId number
info.subgroupId number

void


onSubgroupReset?(info): void;

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

A subgroup stream was reset — objects from it may be missing. Reported for every reset the session receives; a relay that drops a reset instead of forwarding it leaves nothing to report.

Parameter Type
info { error: unknown; groupId: number; }
info.error unknown
info.groupId number

void


onUpdateOk?(): void;

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

Response to a REQUEST_UPDATE sent on this subscription.

void