vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Interface EventDriverEvents

Cross-thread notifications

interface EventDriverEvents ;

"Events" can be used to wake up the event loop of a foreign thread. This is the basis for all kinds of thread synchronization primitives, such as mutexes, condition variables, message queues etc. Such primitives, in case of extended wait periods, should use events rather than traditional means to block, such as busy loops or kernel based wait mechanisms to avoid stalling the event loop.

Properties

NameTypeDescription
userData[set] TRetrieves a reference to a user-defined value associated with a descriptor.

Methods

NameDescription
addRef (descriptor) Increments the reference count of the given event.
cancelWait (event, on_event) Cancels an ongoing wait operation.
create () Creates a new cross-thread event.
releaseRef (descriptor) Decrements the reference count of the given event.
trigger (event, notify_all) Triggers an event owned by the current thread.
trigger (event, notify_all) Triggers an event possibly owned by a different thread.
wait (event, on_event) Waits until an event gets triggered.
rawUserData (descriptor, size, initialize, destroy) Low-level user data access. Use userData instead.
Authors
Copyright
License