|
| createCriticalSectionProvider ( $emergencyLimit, $emergencyCallback=null, $implicitExitCallback=null) |
| Create a CriticalSectionProvider with the specified configuration.
|
|
| enterCriticalSection ( $name, $emergencyLimit, $emergencyCallback) |
|
| exitCriticalSection ( $id) |
|
| setWallTimeLimit ( $limit) |
| Set the wall time 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.
|
|
|
static | singleton () |
| Get a singleton instance of RequestTimeout.
|
|
static | setInstance (?RequestTimeout $instance) |
| Set the instance to be returned by singleton(), or null to clear the instance so that it will be recreated.
|
|
static | factory () |
| Create a new instance of RequestTimeout.
|
|
◆ createCriticalSectionProvider()
Wikimedia\RequestTimeout\RequestTimeout::createCriticalSectionProvider |
( |
| $emergencyLimit, |
|
|
| $emergencyCallback = null, |
|
|
| $implicitExitCallback = null ) |
Create a CriticalSectionProvider with the specified configuration.
- Parameters
-
float | $emergencyLimit | The emergency timeout in seconds |
callable | null | $emergencyCallback | A callback to call when the emergency timeout expires. If null, an exception will be thrown. |
callable | null | $implicitExitCallback | A callback to call if a critical section scope is exited implicitly, rather than by calling exit(). |
- Returns
- CriticalSectionProvider
◆ factory()
static Wikimedia\RequestTimeout\RequestTimeout::factory |
( |
| ) |
|
|
static |
Create a new instance of RequestTimeout.
If the Excimer extension is loaded, this will return a fully functional implementation. If it is not loaded, a fallback implementation will be returned.
- Returns
- RequestTimeout
◆ getWallTimeLimit()
Wikimedia\RequestTimeout\RequestTimeout::getWallTimeLimit |
( |
| ) |
|
|
abstract |
◆ getWallTimeRemaining()
Wikimedia\RequestTimeout\RequestTimeout::getWallTimeRemaining |
( |
| ) |
|
|
abstract |
◆ setInstance()
static Wikimedia\RequestTimeout\RequestTimeout::setInstance |
( |
?RequestTimeout | $instance | ) |
|
|
static |
Set the instance to be returned by singleton(), or null to clear the instance so that it will be recreated.
- Parameters
-
RequestTimeout | null | $instance | |
◆ setWallTimeLimit()
Wikimedia\RequestTimeout\RequestTimeout::setWallTimeLimit |
( |
| $limit | ) |
|
|
abstract |
Set the wall time limit.
If excimer is available, an exception will be thrown after the specified number of seconds.
If excimer is not available, this falls back to set_time_limit(), which causes a fatal error after the CPU time (not wall clock time) exceeds the given number of seconds, which is rounded to an integer.
A time limit of INF or 0 is interpreted as no limit.
- Parameters
-
float | $limit | The limit in seconds |
Reimplemented in Wikimedia\RequestTimeout\Detail\BasicRequestTimeout, and Wikimedia\RequestTimeout\Detail\ExcimerRequestTimeout.
◆ singleton()
static Wikimedia\RequestTimeout\RequestTimeout::singleton |
( |
| ) |
|
|
static |
Get a singleton instance of RequestTimeout.
If the Excimer extension is loaded, this will return a fully functional implementation. If it is not loaded, a fallback implementation will be returned.
- Returns
- RequestTimeout
The documentation for this class was generated from the following file: