Skip to main content

@terascope/teraslice-messaging / execution-controller/server / Server

Class: Server

Extends

Constructors

new Server()

new Server(opts): Server

Parameters

ParameterType
optsServerOptions

Returns

Server

Overrides

Server.constructor

Source

execution-controller/server.ts:13

Properties

_clients

protected _clients: ConnectedClients

Inherited from

Server._clients

Source

messenger/server.ts:33


actionTimeout

protected actionTimeout: number

Inherited from

Server.actionTimeout

Source

messenger/core.ts:15


clientDisconnectTimeout

readonly clientDisconnectTimeout: number

Inherited from

Server.clientDisconnectTimeout

Source

messenger/server.ts:31


closed

closed: boolean = false

Inherited from

Server.closed

Source

messenger/core.ts:12


executionReady

executionReady: boolean

Source

execution-controller/server.ts:11


httpServer

readonly httpServer: Server<typeof IncomingMessage, typeof ServerResponse>

Inherited from

Server.httpServer

Source

messenger/server.ts:29


isShuttingDown

isShuttingDown: boolean

Inherited from

Server.isShuttingDown

Source

messenger/server.ts:26


logger

protected logger: Logger

Inherited from

Server.logger

Source

messenger/core.ts:16


networkLatencyBuffer

protected networkLatencyBuffer: number

Inherited from

Server.networkLatencyBuffer

Source

messenger/core.ts:14


port

readonly port: number

Inherited from

Server.port

Source

messenger/server.ts:27


queue

queue: Queue<EnqueuedWorker>

Source

execution-controller/server.ts:10


server

readonly server: Server

Inherited from

Server.server

Source

messenger/server.ts:28


serverName

readonly serverName: string

Inherited from

Server.serverName

Source

messenger/server.ts:30

Accessors

activeWorkerCount

get activeWorkerCount(): number

Returns

number

Source

execution-controller/server.ts:132


availableClientCount

get availableClientCount(): number

Returns

number

Source

messenger/server.ts:190


availableClients

get availableClients(): ConnectedClient[]

Returns

ConnectedClient[]

Source

messenger/server.ts:186


disconnectedClientCount

get disconnectedClientCount(): number

Returns

number

Source

messenger/server.ts:182


disconnectedClients

get disconnectedClients(): ConnectedClient[]

Returns

ConnectedClient[]

Source

messenger/server.ts:178


onlineClientCount

get onlineClientCount(): number

Returns

number

Source

messenger/server.ts:174


onlineClients

get onlineClients(): ConnectedClient[]

Returns

ConnectedClient[]

Source

messenger/server.ts:170


unavailableClientCount

get unavailableClientCount(): number

Returns

number

Source

messenger/server.ts:198


unavailableClients

get unavailableClients(): ConnectedClient[]

Returns

ConnectedClient[]

Source

messenger/server.ts:194


workerQueueSize

get workerQueueSize(): number

Returns

number

Source

execution-controller/server.ts:136

Methods

close()

close(): void

Returns

void

Inherited from

Server.close

Source

messenger/core.ts:38


dequeueWorker()

dequeueWorker(slice): null | string

Parameters

ParameterType
sliceSlice

Returns

null | string

Source

execution-controller/server.ts:70


dispatchSlice()

dispatchSlice(slice, workerId): Promise<boolean>

Parameters

ParameterType
sliceSlice
workerIdstring

Returns

Promise<boolean>

Source

execution-controller/server.ts:75


emit()

emit(eventName, msg): void

Parameters

ParameterType
eventNamestring
msgEventMessage

Returns

void

Inherited from

Server.emit

Source

messenger/core.ts:132


ensureClient()

protected ensureClient(socket): ConnectedClient

Parameters

ParameterType
socketSocket

Returns

ConnectedClient

Inherited from

Server.ensureClient

Source

messenger/server.ts:361


getClientMetadataFromSocket()

protected getClientMetadataFromSocket(socket): ClientSocketMetadata

Parameters

ParameterType
socketSocket

Returns

ClientSocketMetadata

Inherited from

Server.getClientMetadataFromSocket

Source

messenger/server.ts:307


getTimeout()

getTimeout(timeout?): number

Parameters

ParameterType
timeout?number

Returns

number

Inherited from

Server.getTimeout

Source

messenger/core.ts:127


getTimeoutWithMax()

getTimeoutWithMax(maxTimeout): number

Parameters

ParameterType
maxTimeoutnumber

Returns

number

Inherited from

Server.getTimeoutWithMax

Source

messenger/core.ts:122


handleResponse()

protected handleResponse(socket, eventName, fn): void

Parameters

ParameterType
socketSocketEmitter
eventNamestring
fnMessageHandler

Returns

void

Inherited from

Server.handleResponse

Source

messenger/core.ts:64


handleSendResponse()

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

Parameters

ParameterType
sentMessage

Returns

Promise<null | Message>

Inherited from

Server.handleSendResponse

Source

messenger/core.ts:43


isClientConnected()

isClientConnected(clientId): boolean

Parameters

ParameterType
clientIdstring

Returns

boolean

Inherited from

Server.isClientConnected

Source

messenger/server.ts:301


isClientReady()

isClientReady(clientId): boolean

Parameters

ParameterType
clientIdstring

Returns

boolean

Inherited from

Server.isClientReady

Source

messenger/server.ts:244


listen()

listen(): Promise<void>

Returns

Promise<void>

Inherited from

Server.listen

Source

messenger/server.ts:96


onClientAvailable()

onClientAvailable(fn): this

Parameters

ParameterType
fn(clientId) => void

Returns

this

Inherited from

Server.onClientAvailable

Source

messenger/server.ts:208


onClientDisconnect()

onClientDisconnect(fn): this

Parameters

ParameterType
fn(clientId) => void

Returns

this

Inherited from

Server.onClientDisconnect

Source

messenger/server.ts:220


onClientError()

onClientError(fn): this

Parameters

ParameterType
fn(clientId) => void

Returns

this

Inherited from

Server.onClientError

Source

messenger/server.ts:238


onClientOnline()

onClientOnline(fn): this

Parameters

ParameterType
fn(clientId) => void

Returns

this

Inherited from

Server.onClientOnline

Source

messenger/server.ts:202


onClientReconnect()

onClientReconnect(fn): this

Parameters

ParameterType
fn(clientId) => void

Returns

this

Inherited from

Server.onClientReconnect

Source

messenger/server.ts:232


onClientShutdown()

onClientShutdown(fn): this

Parameters

ParameterType
fn(clientId) => void

Returns

this

Inherited from

Server.onClientShutdown

Source

messenger/server.ts:226


onClientUnavailable()

onClientUnavailable(fn): this

Parameters

ParameterType
fn(clientId) => void

Returns

this

Inherited from

Server.onClientUnavailable

Source

messenger/server.ts:214


onSliceFailure()

onSliceFailure(fn): void

Parameters

ParameterType
fn(workerId, payload) => void

Returns

void

Source

execution-controller/server.ts:115


onSliceSuccess()

onSliceSuccess(fn): void

Parameters

ParameterType
fn(workerId, payload) => void

Returns

void

Source

execution-controller/server.ts:109


onceWithTimeout()

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

Parameters

ParameterType
eventNamestring
timeout?number

Returns

Promise<any>

Inherited from

Server.onceWithTimeout

Source

messenger/core.ts:139


send()

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

Parameters

ParameterType
clientIdstring
eventNamestring
payloadPayload
optionsSendOptions

Returns

Promise<null | Message>

Inherited from

Server.send

Source

messenger/server.ts:260


sendExecutionFinishedToAll()

sendExecutionFinishedToAll(exId): Promise<(null | Message)[]>

Parameters

ParameterType
exIdstring

Returns

Promise<(null | Message)[]>

Source

execution-controller/server.ts:121


sendToAll()

protected sendToAll(eventName, payload?, options?): Promise<(null | Message)[]>

Parameters

ParameterType
eventNamestring
payload?Payload
options?SendOptions

Returns

Promise<(null | Message)[]>

Inherited from

Server.sendToAll

Source

messenger/server.ts:249


shutdown()

shutdown(): Promise<void>

Returns

Promise<void>

Overrides

Server.shutdown

Source

execution-controller/server.ts:60


start()

start(): Promise<void>

Returns

Promise<void>

Source

execution-controller/server.ts:38


updateClientState()

protected updateClientState(clientId, state): boolean

Parameters

ParameterType
clientIdstring
stateClientState

Returns

boolean

Inherited from

Server.updateClientState

Source

messenger/server.ts:328


waitForClientReady()

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

Parameters

ParameterType
clientIdstring
timeout?number

Returns

Promise<boolean>

Inherited from

Server.waitForClientReady

Source

messenger/core.ts:108