phasync
Pool / discard

Method

Pool::discard

Gives a borrowed instance back as broken: the pool forgets it, passes it to $dispose, and makes a new one when needed.

Description#

public Pool::discard(
    object $instance
): void

Parameters#

$instance object
An instance from borrow()

Errors / Exceptions#

ExceptionWhen
LogicExceptionIf the pool did not lend it

See also#

  • Pool::releaseGives a borrowed instance back, for the next borrower.