Zth (libzth)
|
Fiber-aware poller. More...
Classes | |
struct | zth::Pollable |
A pollable thing. More... | |
struct | zth::PollableFd |
A pollable file descriptor. More... | |
class | zth::PollerInterface |
Abstract base class of a poller. More... | |
class | zth::PollerClientBase |
The abstract base class of a Poller client. More... | |
class | zth::PollerServerBase |
Abstract base class of a Poller server. More... | |
class | zth::PollerServer< PollItem_ > |
Poller to be executed by the Waiter. More... | |
class | zth::ZmqPoller |
A PollerServer that uses zmq_poll() . More... | |
class | zth::PollerClient |
The poller to be used by a fiber. More... | |
Typedefs | |
typedef PollerClient | zth::Poller |
The default Poller to use. More... | |
typedef ZmqPoller | zth::DefaultPollerServer |
The poller server, by default instantiated by the zth::Waiter. More... | |
Functions | |
template<typename P > | |
int | zth::poll (P pollable, int timeout_ms=-1) |
Fiber-aware poll () for a single pollable thing. More... | |
Fiber-aware poller.
In order to wait for multiple file descriptors, one could use poll()
. However, when poll()
suspends, it suspends not only the current fiber, but the whole application.
Zth's poller implementation is a fiber-aware, extendable poller implementation, that uses either zmq_poll()
or the OS's poll()
. However, it has the following limitation: in Windows, only WSA2 or ZeroMQ sockets can be polled; the provided file descriptor must be one of those. Other fds, like a normal file or stdin, are not supported. For POSIX-like systems, any fd can be used.
The poller server, by default instantiated by the zth::Waiter.
typedef PollerClient zth::Poller |