Event
final class Event (View source)
Event.
Event class represents and event firing on a file descriptor being ready to read from or write to; a file descriptor becoming ready to read from or write to(edge-triggered I/O only); a timeout expiring; a signal occurring; a user-triggered event. Every event is associated with EventBase . However, event will never fire until it is added (via Event::add() ). An added event remains in pending state until the registered event occurs, thus turning it to active state. To handle events user may register a callback which is called when event becomes active. If event is configured persistent , it remains pending. If it is not persistent, it stops being pending when it's callback runs. Event::del() method deletes event, thus making it non-pending. By means of Event::add() method it could be added again.
Constants
ET |
|
PERSIST |
|
READ |
|
WRITE |
|
SIGNAL |
|
TIMEOUT |
|
Properties
bool | $pending |
Methods
add.
addSignal.
addTimer.
del.
delSignal.
delTimer.
free.
getSupportedMethods.
pending.
setPriority.
Details
__construct(EventBase $base, mixed $fd, int $what, callable $cb, mixed $arg = null)
__construct.
Constructs Event object.
bool
add(float $timeout = -1)
add.
Makes event pending.
bool
addSignal(float $timeout = -1)
addSignal.
Makes signal event pending.
bool
addTimer(float $timeout = -1)
addTimer.
Makes timer event pending.
bool
del()
del.
Makes event non-pending.
bool
delSignal()
delSignal.
Makes signal event non-pending.
bool
delTimer()
delTimer.
Makes timer event non-pending.
void
free()
free.
Make event non-pending and free resources allocated for this event.
static array
getSupportedMethods()
getSupportedMethods.
Returns array with of the names of the methods supported in this version of Libevent.
bool
pending(int $flags)
pending.
Detects whether event is pending or scheduled.
bool
set(EventBase $base, mixed $fd, int $what, callable $cb, mixed $arg)
set.
Re-configures event.
bool
setPriority(int $priority)
setPriority.
Set event priority.
bool
setTimer(EventBase $base, callable $cb, mixed $arg)
setTimer.
Re-configures timer event.
static Event
signal(EventBase $base, int $signum, callable $cb, mixed $arg)
signal.
Constructs signal event object.