Module event
Core events
Fundament event sources exposed by deai. This is the building blocks of other event sources.
See dbus, evdev, event, file, hwinfo, log, lua, misc, os, spawn, udev, xorg for more information about this type
Methods
Wait for any of the given promises to resolve. |
|
File descriptor events |
|
Wait for all given promises resolve. |
|
Create a new promise object |
|
Periodic timer event |
|
Create a new promise that is already resolved |
|
Timer events |
- any_promise(promises) Promise
-
Wait for any of the given promises to resolve.
Returns a promise that resolves when any of the given promises resolves. The returned promise will resolve with the value of the first promise that resolves.
- fdevent(fd, flag) IoEv
- Return type:
- Parameters:
fd (integer)
flag (integer) – bit mask of which events to monitor. bit 0 for readability, bit 1 for writability.
File descriptor events
Wait for a file descriptor to be readable/writable.
- join_promises(promises) Promise
-
Wait for all given promises resolve.
Returns a promises that resolves into an array, which stores the results of the promises. The promises can resolve in any order.
- periodic(interval, offset) Periodic
- Return type:
- Parameters:
interval (float)
offset (float)
Periodic timer event
A timer that first fire after
offsetseconds, then everyintervalseconds.
- ready_promise(value) Promise
- Return type:
- Parameters:
value (any) – what the returned promise will resolve to
Create a new promise that is already resolved
- timer(timeout) Timer
- Return type:
- Parameters:
timeout (float) – timeout in seconds
Timer events
Create a timer that emits a signal after timeout is reached. Note that signals will only be emitted if listeners exist. If no listeners existed during the timeout window, the singal will be emitted when the first listener is attached.