Skip to content

Class: RecoveryController ​

Extends ​

Constructors ​

Constructor ​

ts
new RecoveryController(
   callbacks, 
   timings, 
   clock, 
   random?
): RecoveryController;

Parameters ​

ParameterTypeDefault value
callbacksControllerCallbacksundefined
timingsTimingsundefined
clockClockundefined
random() => numberMath.random

Returns ​

RecoveryController

Overrides ​

Emitter.constructor

Accessors ​

recovering ​

Get Signature ​

ts
get recovering(): boolean;

True while either path is working. One flag, two paths, as promised.

Returns ​

boolean


state ​

Get Signature ​

ts
get state(): ConnectionState;
Returns ​

ConnectionState

Methods ​

emit() ​

ts
emit<K>(event, ...args): void;

A throwing listener must not stop the others, and must not fail the transition that emitted the event: an exception in a host's onError handler would otherwise tear down the call it was reporting on.

Type Parameters ​

Type Parameter
K extends keyof ControllerEvents

Parameters ​

ParameterType
eventK
...argsControllerEvents[K]

Returns ​

void

Inherited from ​

Emitter.emit


listenerCount() ​

ts
listenerCount(event): number;

Parameters ​

ParameterType
eventkeyof ControllerEvents

Returns ​

number

Inherited from ​

Emitter.listenerCount


off() ​

ts
off<K>(event, listener): void;

Type Parameters ​

Type Parameter
K extends keyof ControllerEvents

Parameters ​

ParameterType
eventK
listenerListener<ControllerEvents[K]>

Returns ​

void

Inherited from ​

Emitter.off


on() ​

ts
on<K>(event, listener): () => void;

Type Parameters ​

Type Parameter
K extends keyof ControllerEvents

Parameters ​

ParameterType
eventK
listenerListener<ControllerEvents[K]>

Returns ​

() => void

Inherited from ​

Emitter.on


once() ​

ts
once<K>(event, listener): () => void;

Type Parameters ​

Type Parameter
K extends keyof ControllerEvents

Parameters ​

ParameterType
eventK
listenerListener<ControllerEvents[K]>

Returns ​

() => void

Inherited from ​

Emitter.once


onIceDisconnected() ​

ts
onIceDisconnected(): void;

ICE said disconnected: nothing has arrived for the browser's own silence window. If it is still so iceDisconnectedGraceMs later, that is the sustained failure step 1 is for. The quality samples cannot say it: a stream that receives nothing reports no loss.

Returns ​

void


onIceFailed() ​

ts
onIceFailed(): void;

ICE said failed, which needs no streak: it is already terminal for that connection.

Returns ​

void


onMediaHealthy() ​

ts
onMediaHealthy(): void;

Media is flowing. Resets the streak, the ladder, and a pending disconnect.

Returns ​

void


onQuality() ​

ts
onQuality(bad): void;

A quality sample. Three consecutive bad ones start the media ladder.

Parameters ​

ParameterType
badboolean

Returns ​

void


onSignalingLost() ​

ts
onSignalingLost(cause): void;

The socket is gone, or has stopped answering. Either way this is the same path: back off, then resume.

Parameters ​

ParameterType
causeReconnectCause

Returns ​

void


removeAllListeners() ​

ts
removeAllListeners(): void;

Returns ​

void

Inherited from ​

Emitter.removeAllListeners


start() ​

ts
start(): Promise<void>;

The first connect. Failures here are the host's to see immediately — a bad token is not something to retry behind a spinner.

Returns ​

Promise<void>


stop() ​

ts
stop(): void;

Returns ​

void

Talkline documentation