PHP Class mpyw\Co\Internal\AbstractScheduler

Mostra file Open project: mpyw/co Class Usage Examples

Protected Properties

Property Type Description
$added array cURL handles those have been already dispatched.
$deferreds array Deferreds.
$mh resource cURL multi handle.
$options CoOption Options.

Public Methods

Method Description
__construct ( CoOption $options, resource $mh ) Constructor.
add ( resource $ch ) : React\Promise\PromiseInterface Call curl_multi_add_handle() or push into queue.
consume ( ) Poll completed cURL entries, consume cURL queue and resolve them.
isEmpty ( ) : boolean Are there no cURL handles?

Protected Methods

Method Description
interruptConsume ( ) Do somthing with consumed handle.
readCompletedEntries ( ) : array Poll completed cURL entries.
resolveEntries ( array $entries ) Resolve polled cURLs.

Method Details

__construct() abstract public method

Initialize cURL multi handle.
abstract public __construct ( CoOption $options, resource $mh )
$options CoOption
$mh resource curl_multi

add() abstract public method

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

consume() public method

Poll completed cURL entries, consume cURL queue and resolve them.
public consume ( )

interruptConsume() abstract protected method

Do somthing with consumed handle.
abstract protected interruptConsume ( )

isEmpty() abstract public method

Are there no cURL handles?
abstract public isEmpty ( ) : boolean
return boolean

readCompletedEntries() protected method

Poll completed cURL entries.
protected readCompletedEntries ( ) : array
return array

resolveEntries() protected method

Resolve polled cURLs.
protected resolveEntries ( array $entries )
$entries array Polled cURL entries.

Property Details

$added protected_oe property

cURL handles those have been already dispatched.
protected array $added
return array

$deferreds protected_oe property

Deferreds.
protected array $deferreds
return array

$mh protected_oe property

cURL multi handle.
protected resource $mh
return resource

$options protected_oe property

Options.
protected CoOption,mpyw\Co\Internal $options
return CoOption