|
qb
2.0.0.0
C++17 Actor Framework
|
Event for handling time-based operations (timers and timeouts). More...
#include <timer.h>


Public Types | |
| using | base_t = base<ev::timer> |
| Base type alias for base<ev::timer>. | |
| Public Types inherited from qb::io::async::event::base< ev::timer > | |
| using | ev_t |
| Alias for the underlying libev event watcher type. | |
Public Member Functions | |
| timer (ev::loop_ref loop) | |
| Constructor. | |
| Public Member Functions inherited from qb::io::async::event::base< ev::timer > | |
| base (ev::loop_ref loop) | |
| Constructor. | |
Additional Inherited Members | |
| Public Attributes inherited from qb::io::async::event::base< ev::timer > | |
| IRegisteredKernelEvent * | _interface |
| Pointer to the kernel event interface responsible for handling this event. | |
| int | _revents |
| Stores the event flags (e.g., EV_READ, EV_WRITE) received from libev when the event triggers. | |
Event for handling time-based operations (timers and timeouts).
This event extends qb::io::async::event::base<ev::timer> and thus wraps an ev::timer watcher from libev. It provides the ability to schedule callbacks after a certain delay or at regular intervals. It's the foundation for qb::io::async::with_timeout and qb::io::async::callback.
When a handler receives this event, it means the timer has expired. The underlying ev::timer can be configured for one-shot or repeating behavior.
Usage Example (within a class using with_timeout which manages a timer event internally):
|
inlineexplicit |
Constructor.
| loop | Reference to the libev event loop (ev::loop_ref) this timer watcher will be associated with. |