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

A fallback implementation used when Excimer is not available. More...

+ Inheritance diagram for Wikimedia\RequestTimeout\Detail\BasicRequestTimeout:
+ Collaboration diagram for Wikimedia\RequestTimeout\Detail\BasicRequestTimeout:

Public Member Functions

 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.
 
- Public Member Functions inherited from Wikimedia\RequestTimeout\RequestTimeout
 createCriticalSectionProvider ( $emergencyLimit, $emergencyCallback=null, $implicitExitCallback=null)
 Create a CriticalSectionProvider with the specified configuration.
 

Additional Inherited Members

- Static Public Member Functions inherited from Wikimedia\RequestTimeout\RequestTimeout
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.
 

Detailed Description

A fallback implementation used when Excimer is not available.

Member Function Documentation

◆ enterCriticalSection()

Wikimedia\RequestTimeout\Detail\BasicRequestTimeout::enterCriticalSection ( $name,
$emergencyLimit,
$emergencyCallback )

◆ exitCriticalSection()

Wikimedia\RequestTimeout\Detail\BasicRequestTimeout::exitCriticalSection ( $id)

◆ getWallTimeLimit()

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

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

Returns
float

Reimplemented from Wikimedia\RequestTimeout\RequestTimeout.

◆ getWallTimeRemaining()

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

Get the amount of time remaining of the limit.

If there is no limit, INF will be returned.

Returns
float

Reimplemented from Wikimedia\RequestTimeout\RequestTimeout.

◆ setWallTimeLimit()

Wikimedia\RequestTimeout\Detail\BasicRequestTimeout::setWallTimeLimit ( $limit)

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$limitThe limit in seconds

Reimplemented from Wikimedia\RequestTimeout\RequestTimeout.


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