Skip to content

@mastondzn/dank-twitch-irc / ResponseAwaiter

Class: ResponseAwaiter

Constructors

new ResponseAwaiter(conn, config)

new ResponseAwaiter(conn, config): ResponseAwaiter

Parameters

conn: SingleConnection

config: AwaitConfig

Returns

ResponseAwaiter

Source

src/await/await-response.ts:81

Properties

config

private readonly config: Required<AwaitConfig>

Source

src/await/await-response.ts:77


conn

private readonly conn: SingleConnection

Source

src/await/await-response.ts:76


promise

readonly promise: Promise<undefined | IRCMessage>

Source

src/await/await-response.ts:73


rejectPromise

private rejectPromise: (reason) => void

Parameters

reason: Error

Returns

void

Source

src/await/await-response.ts:79


resolvePromise

private resolvePromise: (message) => void

Parameters

message: undefined | IRCMessage

Returns

void

Source

src/await/await-response.ts:78


unsubscribers

private readonly unsubscribers: () => void[] = []

Source

src/await/await-response.ts:75

Methods

beginTimeout()

private beginTimeout(): void

Returns

void

Source

src/await/await-response.ts:148


joinPendingResponsesQueue()

private joinPendingResponsesQueue(): void

Returns

void

Source

src/await/await-response.ts:159


movedToQueueHead()

movedToQueueHead(): void

Called when this response awaiter is inserted to the head of the queue or moves to the queue head after a previous response awaiter was rejected or resolved.

Returns

void

Source

src/await/await-response.ts:99


onConnectionClosed()

private onConnectionClosed(cause?): void

Parameters

cause?: Error

Returns

void

Source

src/await/await-response.ts:196


onConnectionMessage()

onConnectionMessage(message): boolean

Parameters

message: IRCMessage

Returns

boolean

Source

src/await/await-response.ts:206


onNoResponse()

private onNoResponse(reason): void

Parameters

reason: string

Returns

void

Source

src/await/await-response.ts:140


outpaced()

outpaced(): void

Called by a later awaiter indicating that this awaiter was still in the queue while the later awaiter matched a response.

Returns

void

Source

src/await/await-response.ts:115


reject()

private reject(cause): void

Parameters

cause: Error

Returns

void

Source

src/await/await-response.ts:130


resolve()

private resolve(message?): void

Parameters

message?: IRCMessage

Returns

void

Source

src/await/await-response.ts:125


subscribeTo()

private subscribeTo<T>(eventName, handler): void

Type parameters

T extends string & Record<never, never> | "CLEARCHAT" | "CLEARMSG" | "GLOBALUSERSTATE" | "HOSTTARGET" | "NOTICE" | "PRIVMSG" | "ROOMSTATE" | "USERNOTICE" | "USERSTATE" | "WHISPER" | "JOIN" | "PART" | "RECONNECT" | "PING" | "PONG" | "CAP" | keyof SpecificClientEvents

Parameters

eventName: T

handler

Returns

void

Source

src/await/await-response.ts:219


unsubscribe()

private unsubscribe(): void

Returns

void

Source

src/await/await-response.ts:121