Class: PoolManager

PoolManager

Manages a pool of RCON connections to distribute the message load.

new PoolManager(options)

Name Type Description
options Object

The configuration options for the pool manager.

Name Type Default Description
client RCONClient

The parent RCON client instance.

connectionsCount number 2 optional

The number of connections to maintain in the pool.

Members

clientRCONClient

connectionsArray.<RCONConnection>

connectionsCountnumber

dispatchDelayMsnumber

isDestroyedboolean

isProcessingQueueboolean

messageQueueArray.<{}>

Methods

Shuts down all active connections and prevents future reconnections.

asyncinit(){Promise.<void>}

Initializes the connection pool by creating the specified number of connections.

Returns:
Type Description
Promise.<void>

asyncsend(options){Promise.<ResponseMessage>}

Queues an RCON message to be sent when capacity is available.

Name Type Description
options Object

The message payload.

Name Type Description
name string

Name of the command.

contentBody Object optional

The main content of the message.

Returns:
Type Description
Promise.<ResponseMessage> The response from the RCON server.