@terascope/teraslice-messaging / execution-controller/server / Server
Class: Server
Extends
Constructors
new Server()
new Server(
opts
):Server
Parameters
Parameter | Type |
---|---|
opts | ServerOptions |
Returns
Overrides
Source
execution-controller/server.ts:13
Properties
_clients
protected
_clients:ConnectedClients
Inherited from
Source
actionTimeout
protected
actionTimeout:number
Inherited from
Source
clientDisconnectTimeout
readonly
clientDisconnectTimeout:number
Inherited from
Server
.clientDisconnectTimeout
Source
closed
closed:
boolean
=false
Inherited from
Source
executionReady
executionReady:
boolean
Source
execution-controller/server.ts:11
httpServer
readonly
httpServer:Server
<typeofIncomingMessage
, typeofServerResponse
>
Inherited from
Source
isShuttingDown
isShuttingDown:
boolean
Inherited from
Source
logger
protected
logger:Logger
Inherited from
Source
networkLatencyBuffer
protected
networkLatencyBuffer:number
Inherited from
Source
port
readonly
port:number
Inherited from
Source
queue
queue:
Queue
<EnqueuedWorker
>
Source
execution-controller/server.ts:10
server
readonly
server:Server
Inherited from
Source
serverName
readonly
serverName:string
Inherited from
Source
Accessors
activeWorkerCount
get
activeWorkerCount():number
Returns
number
Source
execution-controller/server.ts:132
availableClientCount
get
availableClientCount():number
Returns
number
Source
availableClients
get
availableClients():ConnectedClient
[]
Returns
Source
disconnectedClientCount
get
disconnectedClientCount():number
Returns
number
Source
disconnectedClients
get
disconnectedClients():ConnectedClient
[]
Returns
Source
onlineClientCount
get
onlineClientCount():number
Returns
number
Source
onlineClients
get
onlineClients():ConnectedClient
[]
Returns
Source
unavailableClientCount
get
unavailableClientCount():number
Returns
number
Source
unavailableClients
get
unavailableClients():ConnectedClient
[]
Returns
Source
workerQueueSize
get
workerQueueSize():number
Returns
number
Source
execution-controller/server.ts:136
Methods
close()
close():
void
Returns
void
Inherited from
Source
dequeueWorker()
dequeueWorker(
slice
):null
|string
Parameters
Parameter | Type |
---|---|
slice | Slice |
Returns
null
| string
Source
execution-controller/server.ts:70
dispatchSlice()
dispatchSlice(
slice
,workerId
):Promise
<boolean
>
Parameters
Parameter | Type |
---|---|
slice | Slice |
workerId | string |
Returns
Promise
<boolean
>
Source
execution-controller/server.ts:75
emit()
emit(
eventName
,msg
):void
Parameters
Parameter | Type |
---|---|
eventName | string |
msg | EventMessage |
Returns
void
Inherited from
Source
ensureClient()
protected
ensureClient(socket
):ConnectedClient
Parameters
Parameter | Type |
---|---|
socket | Socket |
Returns
Inherited from
Source
getClientMetadataFromSocket()
protected
getClientMetadataFromSocket(socket
):ClientSocketMetadata
Parameters
Parameter | Type |
---|---|
socket | Socket |
Returns
Inherited from
Server
.getClientMetadataFromSocket
Source
getTimeout()
getTimeout(
timeout
?):number
Parameters
Parameter | Type |
---|---|
timeout ? | number |
Returns
number
Inherited from
Source
getTimeoutWithMax()
getTimeoutWithMax(
maxTimeout
):number
Parameters
Parameter | Type |
---|---|
maxTimeout | number |
Returns
number
Inherited from
Source
handleResponse()
protected
handleResponse(socket
,eventName
,fn
):void
Parameters
Parameter | Type |
---|---|
socket | SocketEmitter |
eventName | string |
fn | MessageHandler |
Returns
void
Inherited from
Source
handleSendResponse()
protected
handleSendResponse(sent
):Promise
<null
|Message
>
Parameters
Parameter | Type |
---|---|
sent | Message |
Returns
Promise
<null
| Message
>
Inherited from
Source
isClientConnected()
isClientConnected(
clientId
):boolean
Parameters
Parameter | Type |
---|---|
clientId | string |
Returns
boolean
Inherited from
Source
isClientReady()
isClientReady(
clientId
):boolean
Parameters
Parameter | Type |
---|---|
clientId | string |
Returns
boolean
Inherited from
Source
listen()
listen():
Promise
<void
>
Returns
Promise
<void
>
Inherited from
Source
onClientAvailable()
onClientAvailable(
fn
):this
Parameters
Parameter | Type |
---|---|
fn | (clientId ) => void |
Returns
this
Inherited from
Source
onClientDisconnect()
onClientDisconnect(
fn
):this
Parameters
Parameter | Type |
---|---|
fn | (clientId ) => void |
Returns
this
Inherited from
Source
onClientError()
onClientError(
fn
):this
Parameters
Parameter | Type |
---|---|
fn | (clientId ) => void |
Returns
this
Inherited from
Source
onClientOnline()
onClientOnline(
fn
):this
Parameters
Parameter | Type |
---|---|
fn | (clientId ) => void |
Returns
this
Inherited from
Source
onClientReconnect()
onClientReconnect(
fn
):this
Parameters
Parameter | Type |
---|---|
fn | (clientId ) => void |
Returns
this
Inherited from
Source
onClientShutdown()
onClientShutdown(
fn
):this
Parameters
Parameter | Type |
---|---|
fn | (clientId ) => void |
Returns
this
Inherited from
Source
onClientUnavailable()
onClientUnavailable(
fn
):this
Parameters
Parameter | Type |
---|---|
fn | (clientId ) => void |
Returns
this
Inherited from
Source
onSliceFailure()
onSliceFailure(
fn
):void
Parameters
Parameter | Type |
---|---|
fn | (workerId , payload ) => void |
Returns
void
Source
execution-controller/server.ts:115
onSliceSuccess()
onSliceSuccess(
fn
):void
Parameters
Parameter | Type |
---|---|
fn | (workerId , payload ) => void |
Returns
void
Source
execution-controller/server.ts:109
onceWithTimeout()
onceWithTimeout(
eventName
,timeout
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
eventName | string |
timeout ? | number |
Returns
Promise
<any
>
Inherited from
Source
send()
protected
send(clientId
,eventName
,payload
,options
):Promise
<null
|Message
>
Parameters
Parameter | Type |
---|---|
clientId | string |
eventName | string |
payload | Payload |
options | SendOptions |
Returns
Promise
<null
| Message
>
Inherited from
Source
sendExecutionFinishedToAll()
sendExecutionFinishedToAll(
exId
):Promise
<(null
|Message
)[]>
Parameters
Parameter | Type |
---|---|
exId | string |
Returns
Promise
<(null
| Message
)[]>
Source
execution-controller/server.ts:121
sendToAll()
protected
sendToAll(eventName
,payload
?,options
?):Promise
<(null
|Message
)[]>
Parameters
Parameter | Type |
---|---|
eventName | string |
payload ? | Payload |
options ? | SendOptions |
Returns
Promise
<(null
| Message
)[]>
Inherited from
Source
shutdown()
shutdown():
Promise
<void
>
Returns
Promise
<void
>
Overrides
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
Parameter | Type |
---|---|
clientId | string |
state | ClientState |
Returns
boolean
Inherited from
Source
waitForClientReady()
waitForClientReady(
clientId
,timeout
?):Promise
<boolean
>
Parameters
Parameter | Type |
---|---|
clientId | string |
timeout ? | number |
Returns
Promise
<boolean
>