PHP Class mpyw\Co\Internal\Pool

Mostrar archivo Open project: mpyw/co Class Usage Examples

Public Methods

Method Description
__construct ( CoOption $options ) Constructor.
addCurl ( resource $ch ) : React\Promise\PromiseInterface Call curl_multi_add_handle() or push into queue.
addDelay ( integer $time ) : React\Promise\PromiseInterface Add delay.
reserveHaltException ( Throwable | RuntimeException $e ) Used for halting loop.
wait ( ) Run curl_multi_exec() loop.

Method Details

__construct() public method

Initialize cURL multi handle.
public __construct ( CoOption $options )
$options CoOption

addCurl() public method

Call curl_multi_add_handle() or push into queue.
public addCurl ( resource $ch ) : React\Promise\PromiseInterface
$ch resource
return React\Promise\PromiseInterface

addDelay() public method

Add delay.
public addDelay ( integer $time ) : React\Promise\PromiseInterface
$time integer
return React\Promise\PromiseInterface

reserveHaltException() public method

Used for halting loop.
public reserveHaltException ( Throwable | RuntimeException $e )
$e Throwable | RuntimeException

wait() public method

Run curl_multi_exec() loop.
public wait ( )