User
interface User (View source)
Interface to an user event loop implementation for http\Client::configure()'s $use_eventloop option.
NOTE: This interface was added in v2.6.0, resp. v3.1.0.
Constants
POLL_NONE |
No action. |
POLL_IN |
Poll for read readiness. |
POLL_OUT |
Poll for write readiness. |
POLL_INOUT |
Poll for read/write readiness. |
POLL_REMOVE |
Stop polling for activity on this descriptor. |
Methods
Initialize the event loop.
Run the loop as long as it does not block.
Run the loop.
Register (or deregister) a socket watcher.
Register a timeout watcher.
Wait/poll/select (block the loop) until events fire.
Details
init(callable $run)
Initialize the event loop.
once()
Run the loop as long as it does not block.
NOTE: This method is called by http\Client::once(), so it does not need to have an actual implementation if http\Client::once() is never called.
send()
Run the loop.
NOTE: This method is called by http\Client::send(), so it does not need to have an actual implementation if http\Client::send() is never called.
socket(resource $socket, int $poll)
Register (or deregister) a socket watcher.
timer(int $timeout_ms)
Register a timeout watcher.
wait(int $timeout_ms = null)
Wait/poll/select (block the loop) until events fire.
NOTE: This method is called by http\Client::wait(), so it does not need to have an actual implementation if http\Client::wait() is never called.