RequestTimeout
Request timeout library for Excimer with plain PHP fallback
Loading...
Searching...
No Matches
Wikimedia\RequestTimeout\Detail\ExcimerTimerWrapper Class Reference

It's difficult to avoid the circular reference in $this->timer due to the callback closure, which means this object is not destroyed implicitly when it goes out of scope. More...

Public Member Functions

 enterCriticalSection ( $name, $emergencyLimit, $emergencyCallback)
 
 exitCriticalSection ( $id)
 
 setWallTimeLimit ( $limit)
 
 getWallTimeRemaining ()
 Get the amount of time remaining of the limit.
 
 getWallTimeLimit ()
 Get the current wall time limit, or INF if there is no limit.
 
 stop ()
 Stop and destroy the underlying timer.
 

Detailed Description

It's difficult to avoid the circular reference in $this->timer due to the callback closure, which means this object is not destroyed implicitly when it goes out of scope.

So ExcimerRequestTimeout is split into an implicitly destructible part (ExcimerRequestTimeout) and a part which must be explicitly destroyed (this class).

Member Function Documentation

◆ enterCriticalSection()

Wikimedia\RequestTimeout\Detail\ExcimerTimerWrapper::enterCriticalSection ( $name,
$emergencyLimit,
$emergencyCallback )
Parameters
string$name
float$emergencyLimit
callable | null$emergencyCallback
Returns
int

◆ exitCriticalSection()

Wikimedia\RequestTimeout\Detail\ExcimerTimerWrapper::exitCriticalSection ( $id)
Parameters
int$id
Exceptions
TimeoutException

◆ getWallTimeLimit()

Wikimedia\RequestTimeout\Detail\ExcimerTimerWrapper::getWallTimeLimit ( )

Get the current wall time limit, or INF if there is no limit.

Returns
float

◆ getWallTimeRemaining()

Wikimedia\RequestTimeout\Detail\ExcimerTimerWrapper::getWallTimeRemaining ( )

Get the amount of time remaining of the limit.

Returns
float

◆ setWallTimeLimit()

Wikimedia\RequestTimeout\Detail\ExcimerTimerWrapper::setWallTimeLimit ( $limit)
Parameters
float$limitThe limit in seconds

The documentation for this class was generated from the following file: