Skip to content

five-on-it / apps/server/src/rtc-wire / Outbox

Class: Outbox<C> ​

Defined in: apps/server/src/rtc-wire.ts:79

Collects a turn's control messages and frames, and posts them once, at the end of the turn.

Type Parameters ​

C ​

C

Constructors ​

Constructor ​

new Outbox<C>(post, schedule?): Outbox<C>

Defined in: apps/server/src/rtc-wire.ts:89

schedule runs the flush after the turn (setImmediate; the tests flush by hand).

Parameters ​

post ​

PostBatch<C>

schedule? ​

(run) => void

Returns ​

Outbox<C>

Methods ​

flush() ​

flush(): void

Defined in: apps/server/src/rtc-wire.ts:109

Posts what the turn queued, if anything.

Returns ​

void


frame() ​

frame(peer, data): void

Defined in: apps/server/src/rtc-wire.ts:101

Queues a frame for a peer (copied into the turn's buffer when it is posted).

Parameters ​

peer ​

number

data ​

Uint8Array

Returns ​

void


send() ​

send(message): void

Defined in: apps/server/src/rtc-wire.ts:95

Queues a control message.

Parameters ​

message ​

C

Returns ​

void