Class: CZTop::Poller::ZMQ::PollerEvent
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- CZTop::Poller::ZMQ::PollerEvent
- Defined in:
- lib/cztop/poller/zmq.rb
Overview
This represents a zmq_poller_event_t
as in:
typedef struct zmq_poller_event_t
{
void *socket;
int fd;
void *user_data;
short events;
} zmq_poller_event_t;
Instance Method Summary collapse
-
#readable? ⇒ Boolean
Whether the socket is readable.
-
#writable? ⇒ Boolean
Whether the socket is writable.
Instance Method Details
#readable? ⇒ Boolean
Returns whether the socket is readable.
35 36 37 |
# File 'lib/cztop/poller/zmq.rb', line 35 def readable? (self[:events] & POLLIN).positive? end |
#writable? ⇒ Boolean
Returns whether the socket is writable.
41 42 43 |
# File 'lib/cztop/poller/zmq.rb', line 41 def writable? (self[:events] & POLLOUT).positive? end |