Asyncore
|
Static Public Member Functions | |
static | isWindows () |
static | on (string $event, callable $function) |
static | fire (string $event, array $parameters=[]) |
static | addInessential (callable $function, float $interval_seconds=0.001, bool $call_immediately=false) |
static | condition (callable $condition_function) |
static | exitLoop () |
static | loop (?callable $condition_function=null) |
static | timeout (callable $callback, float $seconds) |
static | add (callable $function, float $interval_seconds=0.001, bool $call_immediately=false, bool $essential=true) |
static | worker (string $worker_file, callable $message_handler) |
static | curl_exec (&$ch, callable $callback) |
static | init () |
Static Public Attributes | |
static | $recalculate_loops = true |
static | $conditions |
|
static |
Registers a function to be called every X seconds.
callable | $function | |
float | $interval_seconds | |
bool | $call_immediately | True if the function should be called immediately, false if the interval should expire first. |
bool | $essential | False if the function should only be called if at least one other essential function exists. |
|
static |
Registers a function to be called every X seconds if at least one other essential loop exists.
callable | $function | |
float | $interval_seconds | |
bool | $call_immediately | True if the function should be called immediately, false if the interval should expire first. |
|
static |
|
static |
Drop-in replacement for curl_exec
. Instead of blocking until the request has finished, this immediately returns and the result will be passed to the callback function when the request is finished.
resource | $ch | |
callable | $callback |
|
static |
Causes the Asyncore::loop() function to return, if it is currently running.
|
static |
Calls all event handlers for the given event.
string | $event | |
array | $parameters |
|
static |
Used internally to initialize Asyncore's default Conditions.
|
static |
Returns true if the code is running on a Windows machine.
|
static |
Runs Asyncore's loop. This should be the last call in your script.
callable | null | $condition_function | An optional function to determine when this function should return. |
|
static |
Registers an event handler.
string | $event | |
callable | $function |
|
static |
Calls the given function in x seconds.
callable | $callback | |
float | $seconds |
|
static |
Creates a new PHP thread running the given file.
string | $worker_file | The absolute path to the worker's php file. |
callable | $message_handler | The function to be called when the worker sends a message. |
|
static |
|
static |