ClusterHostOptions
Defined in: packages/sharding/src/host.ts:15
Options for a ClusterHost.
Properties
Section titled âPropertiesâallowInsecure?
Section titled âallowInsecure?â
optionalallowInsecure?:boolean
Defined in: packages/sharding/src/host.ts:24
Connect with ws:// to a coordinator on another machine, over a network you fully trust. Default false.
connectAttempts?
Section titled âconnectAttempts?â
optionalconnectAttempts?:number
Defined in: packages/sharding/src/host.ts:48
Attempts connect() makes while the coordinator is busy (it answers
âtoo many connectionsâ or the hello timed out) before it gives up.
Default 10. A refusal (bad secret, unknown or duplicate id) is final.
optionalfork?: (script,env) =>ChildProcess
Defined in: packages/sharding/src/host.ts:35
Starts a worker process. Defaults to child_process.fork().
Parameters
Section titled âParametersâstring
Record<string, string | undefined>
Returns
Section titled âReturnsâChildProcess
id:
string
Defined in: packages/sharding/src/host.ts:28
This hostâs ID: letters, digits, ., _, -. Must be unique in the deployment.
maxReconnectDelay?
Section titled âmaxReconnectDelay?â
optionalmaxReconnectDelay?:number
Defined in: packages/sharding/src/host.ts:42
Longest delay between reconnect attempts, in ms. Default 30,000.
reconnectDelay?
Section titled âreconnectDelay?â
optionalreconnectDelay?:number
Defined in: packages/sharding/src/host.ts:40
First delay before reconnecting, in ms. Default 1000.
script:
string
Defined in: packages/sharding/src/host.ts:33
The worker script this host runs for every cluster. A coordinator cannot choose it: remote workers run only what the host owner configured.
secret:
string
Defined in: packages/sharding/src/host.ts:26
The coordinatorâs shared secret.
url:
string|string[]
Defined in: packages/sharding/src/host.ts:22
The coordinatorâs address: wss://host:port. ws:// is accepted for
this machine, or anywhere with allowInsecure. A list names every
coordinator of a deployment with a leader lock: the host tries them in
turn, and moves to the next whenever one cannot be reached or drops it.