PoolOption
class PoolOption implements PoolOptionInterface
Configuration options for a connection pool.
Constants
| MIN_LIFETIME_JITTER_BASIS |
Lowest max_lifetime fraction assigned to a connection generation. |
| LIFETIME_JITTER_SCALE |
Scale used for jitter basis values. |
Methods
No description
Get the maximum number of connections in the pool.
Set the maximum number of connections in the pool.
Get the managed-connection floor for excess-idle trimming.
Set the managed-connection floor for excess-idle trimming.
Get the connection timeout in seconds.
Set the timeout for establishing a connection.
Get the heartbeat interval in seconds.
Get the heartbeat timeout in seconds.
Set the heartbeat interval in seconds.
Set the heartbeat timeout in seconds.
Get the wait timeout in seconds for acquiring a connection.
Set the timeout for waiting to get a connection from the pool.
Get the maximum idle time in seconds before a connection is closed.
Set the maximum idle time before a connection is closed.
Get the maximum lifetime in seconds before a connection is recycled.
Return a jittered lifetime deadline for a connection generation.
Set the maximum lifetime in seconds before a connection is recycled.
Get the events to trigger on connection lifecycle.
Set the events to trigger on connection lifecycle.
Details
at line 36
__construct(int $minConnections = 1, int $maxConnections = 10, float $connectTimeout = 10.0, float $waitTimeout = 3.0, float $heartbeat = -1, float $heartbeatTimeout = 1.0, float $maxIdleTime = 60.0, float $maxLifetime = -1.0, array $events = [])
No description
at line 57
int
getMaxConnections()
Get the maximum number of connections in the pool.
at line 69
PoolOption
setMaxConnections(int $maxConnections)
Set the maximum number of connections in the pool.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 77
int
getMinConnections()
Get the managed-connection floor for excess-idle trimming.
at line 89
PoolOption
setMinConnections(int $minConnections)
Set the managed-connection floor for excess-idle trimming.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 97
float
getConnectTimeout()
Get the connection timeout in seconds.
at line 109
PoolOption
setConnectTimeout(float $connectTimeout)
Set the timeout for establishing a connection.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 117
float
getHeartbeat()
Get the heartbeat interval in seconds.
at line 122
float
getHeartbeatTimeout()
Get the heartbeat timeout in seconds.
at line 134
PoolOption
setHeartbeat(float $heartbeat)
Set the heartbeat interval in seconds.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 149
PoolOption
setHeartbeatTimeout(float $heartbeatTimeout)
Set the heartbeat timeout in seconds.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 157
float
getWaitTimeout()
Get the wait timeout in seconds for acquiring a connection.
at line 169
PoolOption
setWaitTimeout(float $waitTimeout)
Set the timeout for waiting to get a connection from the pool.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 177
float
getMaxIdleTime()
Get the maximum idle time in seconds before a connection is closed.
at line 189
PoolOption
setMaxIdleTime(float $maxIdleTime)
Set the maximum idle time before a connection is closed.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 200
float
getMaxLifetime()
Get the maximum lifetime in seconds before a connection is recycled.
at line 208
static float
jitteredLifetimeDeadline(float $createdAt, float $maxLifetime)
Return a jittered lifetime deadline for a connection generation.
at line 228
PoolOption
setMaxLifetime(float $maxLifetime)
Set the maximum lifetime in seconds before a connection is recycled.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.
at line 236
array
getEvents()
Get the events to trigger on connection lifecycle.
at line 248
PoolOption
setEvents(array $events)
Set the events to trigger on connection lifecycle.
Boot-only. The value persists on the worker-lifetime pool option and is read by every subsequent pool operation. Per-request use races across coroutines.