Download the PHP package makise-co/pool without Composer
On this page you can find all versions of the php package makise-co/pool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download makise-co/pool
More information about makise-co/pool
Files in makise-co/pool
Download makise-co/pool
More information about makise-co/pool
Files in makise-co/pool
Please rate this library. Is it a good library?
Informations about the package pool
ConnectionPool
Connection Pool based on Swoole with balancer feature implementation
Parameters
- int
maxActive
(default: 2) - The maximum number of active connections that can be allocated from this pool at the same time - int
minActive
(default: 0) - The minimum number of established connections that should be kept in the pool at all times - float
maxWaitTime
(default: 5.0) - The maximum number of seconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception. Zero value (0.0) will disable wait timeout. - float
validationInterval
(default: 5.0) - The number of seconds to sleep between runs of the idle connection validation/cleaner timer. This value should not be set under 1 second. Zero value will disable validate connections timer. - int
maxIdleTime
(default: 60) - The minimum amount of time (seconds) a connection may sit idle in the pool before it is eligible for closing. Zero value will disable idle connections freeing. - int
maxLifeTime
(default: 0) - The maximum amount of time (seconds) a connection may exist in the pool before it is eligible for closing. Zero value will disable expired connections freeing. - bool
testOnBorrow
(default: true) - The indication of whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another. - bool
testOnReturn
(default: true) - The indication of whether objects will be validated before being returned to the pool - bool
resetConnections
(default: false) - Reset the connection to its initial state when it is borrowed from the pool
All of these parameters can be changed at runtime.
API
init
- Initialize (start) connection poolclose
- Close (stop) connection poolgetStats
- Get connection pool statisticspop
(default visibility:protected
) - Borrow connection from pool. May throwBorrowTimeoutException
when waiting of free connection is timed out (readmaxWaitTime
parameter doc). May throwPoolIsClosedException
when connection pool is closed.push
(default visibility:protected
) - Return connection to pool
Getters
getIdleCount
- Get idle connections countgetTotalCount
- Get count of connections created by the poolgetMaxActive
- readmaxActive
parameter docgetMinActive
- readminActive
parameter docgetMaxWaitTime
- readmaxWaitTime
parameter docgetMaxIdleTime
- readmaxIdleTime
parameter docgetMaxLifeTime
- readmaxLifeTime
parameter docgetValidationInterval
- readvalidationInterval
parameter docgetTestOnBorrow
- readtestOnBorrow
parameter docgetTestOnReturn
- readtestOnReturn
parameter docgetResetConnections
- readresetConnections
parameter doc
Setters
setMaxActive
- readmaxActive
parameter docsetMinActive
- readminActive
parameter docsetMaxWaitTime
- readmaxWaitTime
parameter docsetMaxIdleTime
- readmaxIdleTime
parameter docsetMaxLifeTime
- readmaxLifeTime
parameter docsetValidationInterval
- readvalidationInterval
parameter docsetTestOnBorrow
- readtestOnBorrow
parameter docsetTestOnReturn
- readtestOnReturn
parameter docsetResetConnections
- readresetConnections
parameter doc
Complete example (HTTP Connection Pool)
Output is:
All versions of pool with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
ext-swoole Version >=4.4
makise-co/connection Version ^1.0
makise-co/ev-primitives Version ^1.0
ext-swoole Version >=4.4
makise-co/connection Version ^1.0
makise-co/ev-primitives Version ^1.0
The package makise-co/pool contains the following files
Loading the files please wait ....