Nexus API Reference

ConnectionPool
in package

FinalYes
Tags
psalm-api
psalm-type

BorrowMeta = array{takenAt: int}

Table of Contents

Methods

__construct()  : mixed
close()  : void
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 $channel[, EventDispatcherInterface|null $events = null ][, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
$name : string
$factory : ConnectionFactory
$config : PoolConfig
$channel : Channel
$events : EventDispatcherInterface|null = null
$logger : LoggerInterface = new NullLogger()

close()

public close(Duration $timeout) : void
Parameters
$timeout : Duration
Tags
psalm-suppress

UnusedParam $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()

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

T

Return values
T

        
On this page

Search results