SyncEvent
class SyncEvent (View source)
SyncEvent
A cross-platform, native implementation of named and unnamed event objects. Both automatic and manual event objects are supported. An event object waits, without polling, for the object to be fired/set. One instance waits on the event object while another instance fires/sets the event. Event objects are useful wherever a long-running process would otherwise poll a resource (e.g. checking to see if uploaded data needs to be processed).
Methods
SyncEvent constructor.
Fires/sets the event
Resets a manual event
Waits for the event to be fired/set
Details
__construct(string $name, bool $manual = false, bool $prefire = false)
SyncEvent constructor.
bool
fire()
Fires/sets the event
Fires/sets a SyncEvent object. Lets multiple threads through that are waiting if the event object was created with a manual value of TRUE.
bool
reset()
Resets a manual event
Resets a SyncEvent object that has been fired/set. Only valid for manual event objects.
bool
wait(int $wait = -1)
Waits for the event to be fired/set
Waits for the SyncEvent object to be fired.