Home > doofinder > ClientPool

ClientPool class

Manage clients for multiple servers as singletons with shared settings.

Signature:

export declare class ClientPool 

Remarks

GOLDEN RULE: Don’t save references to clients obtained from the pool, always request new ones.

Example

ClientPool.getClient('eu1');
ClientPool.getStatsClient('eu1');

Properties

Property Modifiers Type Description
options static Partial<ClientOptions> Property to change shared options.When changed, all existing clients are removed so new ones get the new options.

Methods

Method Modifiers Description
clear() static Remove al existing clients from the pool.
getClient(server) static Get a client for the given server with the shared options.
getStatsClient(server) static Get a stats client for the given server with the shared options.
reset() static Reset the shared options of the pool.