Class
ClientCluster
Extends EventEmitter
Constructor
new ClientCluster
(options: ClientClusterOptions)| Param | Type | Description |
|---|---|---|
| options | ClientClusterOptions |
Properties
configure
?: ((runtime: ClientRuntime) => void | Promise<void>) | undefined (readonly)destroyed
: booleanpending
: Map<string, Promise<void>> (readonly)runtimes
: Map<string, InternalRuntime> (readonly)size
: number (readonly)Number of managed runtimes (including those still connecting).
Methods
add
(input: AddClientRuntimeOptions): Promise<ClientRuntime>| Param | Type | Description |
|---|---|---|
| input | AddClientRuntimeOptions |
addAll
(inputs: readonly AddClientRuntimeOptions[]): Promise<PromiseSettledResult<ClientRuntime>[]>| Param | Type | Description |
|---|---|---|
| inputs | readonly AddClientRuntimeOptions[] |
destroy
(): Promise<void>detachHandlers
(rt: InternalRuntime): void| Param | Type | Description |
|---|---|---|
| rt | InternalRuntime |
emit
(event: , args: ClientClusterEventMap[]): boolean| Param | Type | Description |
|---|---|---|
| event | K | |
| args | ClientClusterEventMap[] |
emit
(event: string | symbol, args: unknown[]): boolean| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| args | unknown[] |
emit
(event: string | symbol, args: unknown[]): boolean| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| args | unknown[] |
get
(id: string): ClientRuntime | undefined| Param | Type | Description |
|---|---|---|
| id | string |
has
(id: string): boolean| Param | Type | Description |
|---|---|---|
| id | string |
off
(event: , listener: ClientClusterEventListener<>): this| Param | Type | Description |
|---|---|---|
| event | K | |
| listener | ClientClusterEventListener<> |
off
(event: string | symbol, listener: (...args: unknown[]) => void): this| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| listener | (...args: unknown[]) => void |
off
(event: string | symbol, listener: (...args: unknown[]) => void): this| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| listener | (...args: unknown[]) => void |
on
(event: , listener: ClientClusterEventListener<>): this| Param | Type | Description |
|---|---|---|
| event | K | |
| listener | ClientClusterEventListener<> |
on
(event: string | symbol, listener: (...args: unknown[]) => void): this| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| listener | (...args: unknown[]) => void |
on
(event: string | symbol, listener: (...args: unknown[]) => void): this| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| listener | (...args: unknown[]) => void |
once
(event: , listener: ClientClusterEventListener<>): this| Param | Type | Description |
|---|---|---|
| event | K | |
| listener | ClientClusterEventListener<> |
once
(event: string | symbol, listener: (...args: unknown[]) => void): this| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| listener | (...args: unknown[]) => void |
once
(event: string | symbol, listener: (...args: unknown[]) => void): this| Param | Type | Description |
|---|---|---|
| event | string | symbol | |
| listener | (...args: unknown[]) => void |
remove
(id: string): Promise<boolean>| Param | Type | Description |
|---|---|---|
| id | string |
restart
(id: string, opts: RestartClientRuntimeOptions): Promise<ClientRuntime>| Param | Type | Description |
|---|---|---|
| id | string | |
| opts | RestartClientRuntimeOptions |
runAdd
(id: string, token: string, input: AddClientRuntimeOptions, abort: AbortController): Promise<void>| Param | Type | Description |
|---|---|---|
| id | string | |
| token | string | |
| input | AddClientRuntimeOptions | |
| abort | AbortController |
runtimeValues
(): IterableIterator<ClientRuntime>toPublic
(rt: InternalRuntime): ClientRuntime| Param | Type | Description |
|---|---|---|
| rt | InternalRuntime |
values
(): ClientRuntime[]Snapshot of current runtimes.