Skip to main content

@terascope/teraslice-messaging / messenger/client / Client

Class: Client

Extends

Extended by

Constructors

new Client()

new Client(opts, _connectTimeout?): Client

Parameters

ParameterType
optsClientOptions
_connectTimeout?number

Returns

Client

Overrides

Core.constructor

Source

messenger/client.ts:25

Properties

actionTimeout

protected actionTimeout: number

Inherited from

Core.actionTimeout

Source

messenger/core.ts:15


available

available: boolean

Source

messenger/client.ts:21


clientId

readonly clientId: string

Source

messenger/client.ts:16


clientType

readonly clientType: string

Source

messenger/client.ts:17


closed

closed: boolean = false

Inherited from

Core.closed

Source

messenger/core.ts:12


connectTimeout

readonly connectTimeout: number

Source

messenger/client.ts:19


hostUrl

readonly hostUrl: string

Source

messenger/client.ts:20


logger

protected logger: Logger

Inherited from

Core.logger

Source

messenger/core.ts:16


networkLatencyBuffer

protected networkLatencyBuffer: number

Inherited from

Core.networkLatencyBuffer

Source

messenger/core.ts:14


ready

ready: boolean

Source

messenger/client.ts:22


serverName

readonly serverName: string

Source

messenger/client.ts:18


serverShutdown

protected serverShutdown: boolean

Source

messenger/client.ts:23


socket

readonly socket: Socket

Source

messenger/client.ts:15

Methods

close()

close(): void

Returns

void

Inherited from

Core.close

Source

messenger/core.ts:38


connect()

connect(): Promise<void>

Returns

Promise<void>

Source

messenger/client.ts:113


emit()

emit(eventName, msg): void

Parameters

ParameterType
eventNamestring
msgClientEventMessage

Returns

void

Overrides

Core.emit

Source

messenger/client.ts:286


forceReconnect()

forceReconnect(): Promise<void>

Returns

Promise<void>

Source

messenger/client.ts:322


getTimeout()

getTimeout(timeout?): number

Parameters

ParameterType
timeout?number

Returns

number

Inherited from

Core.getTimeout

Source

messenger/core.ts:127


getTimeoutWithMax()

getTimeoutWithMax(maxTimeout): number

Parameters

ParameterType
maxTimeoutnumber

Returns

number

Inherited from

Core.getTimeoutWithMax

Source

messenger/core.ts:122


handleResponse()

protected handleResponse(socket, eventName, fn): void

Parameters

ParameterType
socketSocketEmitter
eventNamestring
fnMessageHandler

Returns

void

Inherited from

Core.handleResponse

Source

messenger/core.ts:64


handleSendResponse()

protected handleSendResponse(sent): Promise<null | Message>

Parameters

ParameterType
sentMessage

Returns

Promise<null | Message>

Inherited from

Core.handleSendResponse

Source

messenger/core.ts:43


isClientReady()

isClientReady(): boolean

Returns

boolean

Overrides

Core.isClientReady

Source

messenger/client.ts:291


onServerShutdown()

onServerShutdown(fn): void

Parameters

ParameterType
fn() => void

Returns

void

Source

messenger/client.ts:99


onceWithTimeout()

onceWithTimeout(eventName, timeout?): Promise<any>

Parameters

ParameterType
eventNamestring
timeout?number

Returns

Promise<any>

Inherited from

Core.onceWithTimeout

Source

messenger/core.ts:139


send()

protected send(eventName, payload, options): Promise<null | Message>

Parameters

ParameterType
eventNamestring
payloadPayload
optionsSendOptions

Returns

Promise<null | Message>

Source

messenger/client.ts:254


sendAvailable()

sendAvailable(payload?): Promise<undefined | null | Message>

Parameters

ParameterType
payload?Payload

Returns

Promise<undefined | null | Message>

Source

messenger/client.ts:236


sendUnavailable()

sendUnavailable(payload?): Promise<undefined | null | Message>

Parameters

ParameterType
payload?Payload

Returns

Promise<undefined | null | Message>

Source

messenger/client.ts:245


shutdown()

shutdown(): Promise<void>

Returns

Promise<void>

Source

messenger/client.ts:295


waitForClientReady()

waitForClientReady(clientId, timeout?): Promise<boolean>

Parameters

ParameterType
clientIdstring
timeout?number

Returns

Promise<boolean>

Inherited from

Core.waitForClientReady

Source

messenger/core.ts:108