XDevAPI implementation of a connection pool. Should be used via the Client API.
Example
const pool = mysqlx.getClient('mysqlx://root@localhost', {
pooling: {
enabled: true,
maxSize: 10,
maxIdleTime: 20000,
queueTimeout: 5000
}
})
pool.getSession()
.then(session => {
// A new session is created using a connection from the pool.
})
Type Definitions
-
Properties
-
Connection pool configuration properties.
Type:
- Object
Properties:
Name Type Argument Default Description enabledboolean <optional>
true use a connection pool maxSizenumber <optional>
25 maximum number of connections in the pool maxIdleTimenumber <optional>
0 maximum number of milliseconds to allow a connection to be idle (0 - infinite) queueTimeoutnumber <optional>
0 maximum number of milliseconds to wait for a connection to become available (0 - infinite)