Nexus API Reference

ConnectionPool
in package

FinalYes
Tags
psalm-api
psalm-type

BorrowMeta = array{takenAt: int}

Table of Contents

Methods

__construct()  : mixed
close()  : void
`$_timeout` is part of the public lifecycle contract; the current sync drain is fast enough that we don't need to enforce the deadline yet, but the param is kept so callers compile against a deadline-aware API.
evictIdleOlderThan()  : void
name()  : string
release()  : void
stats()  : PoolStats
take()  : Connection
warmToMinIdle()  : void
warnOnLeaks()  : void
withConnection()  : T

Methods

__construct()

public __construct(string $name, ConnectionFactory $factory, PoolConfig $config, Channel<string|int, Connection$channel[, EventDispatcherInterface|null $events = null ][, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
$name : string
$factory : ConnectionFactory
$config : PoolConfig
$channel : Channel<string|int, Connection>
$events : EventDispatcherInterface|null = null
$logger : LoggerInterface = new NullLogger()

close()

`$_timeout` is part of the public lifecycle contract; the current sync drain is fast enough that we don't need to enforce the deadline yet, but the param is kept so callers compile against a deadline-aware API.

public close(Duration $_timeout) : void
Parameters
$_timeout : Duration

evictIdleOlderThan()

public evictIdleOlderThan(int $cutoffNanos) : void
Parameters
$cutoffNanos : int

release()

public release(Connection $conn[, bool $poison = false ]) : void
Parameters
$conn : Connection
$poison : bool = false

warnOnLeaks()

public warnOnLeaks(int $nowNanos) : void
Parameters
$nowNanos : int

withConnection()

public withConnection(callable(Connection): T $fn) : T
Parameters
$fn : callable(Connection): T
Tags
template
Return values
T
On this page

Search results