SwitchableHandlers
Defined in: relay-sdks/ts/src/switchable.ts:29
Callbacks for a switchable subscription. Each runs synchronously, for the active subscription’s events only, and receives the active track’s name as its last argument. A pending subscription reaches no handler before its cutover.
Methods
Section titled “Methods”onError()?
Section titled “onError()?”onError?(error, track): void;Defined in: relay-sdks/ts/src/switchable.ts:40
The active subscription ended with REQUEST_ERROR: the first one was rejected, or an accepted one
was refused later. The switchable has ended. A pending subscription’s rejection rejects its
switchTo instead.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error |
RequestError |
track |
string |
Returns
Section titled “Returns”void
onGoaway()?
Section titled “onGoaway()?”onGoaway?(goaway, track): void;Defined in: relay-sdks/ts/src/switchable.ts:55
GOAWAY on the active subscription’s request stream. Informational; nothing is retried.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
goaway |
Goaway |
track |
string |
Returns
Section titled “Returns”void
onObject()?
Section titled “onObject()?”onObject?(object, track): void;Defined in: relay-sdks/ts/src/switchable.ts:42
One object from the active subscription. Payloads are uninterpreted bytes.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
object |
MoqtObject |
track |
string |
Returns
Section titled “Returns”void
onPublisherDone()?
Section titled “onPublisherDone()?”onPublisherDone?(info, track): void;Defined in: relay-sdks/ts/src/switchable.ts:51
The active track’s publisher finished with it (PUBLISH_DONE). Not an ending, as on
RelaySubscriptionHandlers.onPublisherDone; a pending switch carries on.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
info |
PublishDone |
track |
string |
Returns
Section titled “Returns”void
onStateNotify()?
Section titled “onStateNotify()?”onStateNotify?(parameters, track): void;Defined in: relay-sdks/ts/src/switchable.ts:53
The publisher changed the active subscription’s state (PUBLISH_STATE_NOTIFY).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
parameters |
MessageParameters |
track |
string |
Returns
Section titled “Returns”void
onSubgroupEnd()?
Section titled “onSubgroupEnd()?”onSubgroupEnd?(info, track): void;Defined in: relay-sdks/ts/src/switchable.ts:44
One of the active subscription’s subgroup streams finished cleanly (FIN).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
info |
{ endOfGroup: boolean; groupId: number; subgroupId: number; } |
info.endOfGroup |
boolean |
info.groupId |
number |
info.subgroupId |
number |
track |
string |
Returns
Section titled “Returns”void
onSubgroupReset()?
Section titled “onSubgroupReset()?”onSubgroupReset?(info, track): void;Defined in: relay-sdks/ts/src/switchable.ts:46
One of the active subscription’s subgroup streams was reset; objects from it may be missing.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
info |
{ error: unknown; groupId: number; } |
info.error |
unknown |
info.groupId |
number |
track |
string |
Returns
Section titled “Returns”void
onSubscribed()?
Section titled “onSubscribed()?”onSubscribed?(info, track): void;Defined in: relay-sdks/ts/src/switchable.ts:34
The first subscription accepted (SUBSCRIBE_OK). A later subscription’s acceptance arrives with
its cutover, in onSwitched.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
info |
SubscribeOk |
track |
string |
Returns
Section titled “Returns”void
onSwitched()?
Section titled “onSwitched()?”onSwitched?(info): void;Defined in: relay-sdks/ts/src/switchable.ts:60
A cutover: to is now active and from has been cancelled. Runs before the first object of
to, which is the one that passed until. Decoders drop state that assumed continuity here.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
info |
SwitchedInfo |
Returns
Section titled “Returns”void