Connection
abstract class Connection implements ConnectionInterface
Abstract base class for pooled connections.
Provides common functionality for connection lifecycle management including release handling, health checking, and usage tracking.
Properties
| protected float | $lastUseTime | ||
| protected float | $lastReleaseTime | ||
| protected bool | $invalid |
Methods
Release the connection back to the pool.
Discard the connection from its pool.
Get the underlying connection, with retry on failure.
Check if the connection is still valid based on idle time.
Get the last use time.
Get the last release time.
Mark the connection as invalid.
Mark the connection as valid.
Get the active connection, reconnecting if necessary.
Details
at line 33
__construct(Container $container, PoolInterface $pool)
No description
at line 49
void
release()
Release the connection back to the pool.
at line 68
void
discard()
Discard the connection from its pool.
at line 76
mixed
getConnection()
Get the underlying connection, with retry on failure.
at line 90
bool
check()
Check if the connection is still valid based on idle time.
at line 109
float
getLastUseTime()
Get the last use time.
at line 117
float
getLastReleaseTime()
Get the last release time.
at line 125
protected void
markInvalid()
Mark the connection as invalid.
at line 133
protected void
markValid()
Mark the connection as valid.
at line 141
abstract mixed
getActiveConnection()
Get the active connection, reconnecting if necessary.