Skip to content

WantHandlers

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:144

The callbacks a want delivers to. Like RelaySubscriptionHandlers, they must be synchronous.

onError?(error): void;

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:173

A failure the want does not retry, after which it stops and is removed: a REQUEST_ERROR no wait fixes (credentials, an unsupported or malformed request), or discovery refusing the root.

Parameter Type
error unknown

void


onObject?(object): void;

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:151

One object, from whichever subscription is current.

Parameter Type
object MoqtObject

void


onPublisherDone?(info): void;

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:157

The relay sent PUBLISH_DONE on the current subscription; the want resubscribes after its backoff.

Parameter Type
info PublishDone

void


onRestarted?(info): void;

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:162

An accepted subscription ended and the want will replace it: drop decoder state that assumed continuity. Called before any object of the replacement; the gap is never filled.

Parameter Type
info { namespace: string[]; reason: RestartReason; }
info.namespace string[]
info.reason RestartReason

void


onSubgroupEnd?(info): void;

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:153

A subgroup stream ended cleanly.

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/src/supervised-subscriber.ts:155

A subgroup stream was reset.

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

void


onSubscribed?(info, context): void;

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:149

A subscription was accepted; namespace is the one it was made on, the generation’s when following one. A move’s replacement reports its acceptance in onSwitched instead.

Parameter Type
info SubscribeOk
context { namespace: string[]; }
context.namespace string[]

void


onSwitched?(info): void;

Defined in: relay-sdks/ts/src/supervised-subscriber.ts:168

A move’s cutover: the want now delivers from to, and from was cancelled or drains its in-flight groups. Runs before the replacement’s first object, the one that passed until. Decoders drop state that assumed continuity here; no onRestarted or onSubscribed runs for a move.

Parameter Type
info WantSwitchedInfo

void