4 * `LEAVE` - When returned will cause event callback to be cancelled
6 * Marks read readiness/event capture.
7 * Read readiness can also mean that an 'accept' operation will succeed, or
8 a disconnection on the other end is detected (read will return nothing).
10 * Marks write readiness/event capture.
11 * Can also mark the successful completion of a non-blocking connect
12 if `SO_ERROR`@`SOL_SOCKET` is zero.
14 * Marks signal received/event capture
16 * Timeout occurred while waiting for an event
18 * Marks an event as persistent and not one-shot
20 * Can be OR'd together to capture multiple events that make sense.
21 (Should not OR `EV_READ`/`EV_WRITE` with `EV_SIGNAL`)
22 * Can be received OR'd together.
23 For example: `EV_READ` | `EV_TIMEOUT` means that a timeout
24 occurred while waiting for a read event.
26 * Marks that the input buffer has data available > low watermark
28 * Marks that the output buffer level is below low watermark
30 * Received tagged with either read/write based on location received in the error callback
32 * An error occurred (tagged w/ either read/write) and the error is in `errno`
34 * A timeout occurred (tagged w/ either read/write)
41 * Allocates a new event 'core' (`event base`)
45 * Output: `(newEvent, [newTimeout])`
46 * `newEvent` - New event to register, typically `LEAVE`, `EV_READ`, `EV_WRITE`, or `EV_READ`|`EV_WRITE`
47 * `newTimeout` - New timeout value to use
50 * Adds a new event to the eventloop
51 * Input: `(fd, event, event_callback, [timeout])`
52 * `fd` - File descriptor to read from / or NIL for pure timeout event
53 * `event` - `EV_*` flagset to mark what events to capture
54 * `EV_SIGNAL` and `EV_PERSIST` is unavailable currently
55 * `EV_PERSIST` is used internally.
56 * `event_callback` - Callback to call... (see above)
57 * `timeout` - Time in seconds to timeout (decimal values supported)
58 * Output: `event_callback` object
59 * Has a `close` and `__gc` FN which will erase the callback,
60 so preserve this until done.
63 * Begins the event loop and doesn't return until there are no events left
66 * Closes the event base
67 * Do not allow this to be called while `core:loop` is running