Module: CZTop::Poller::ZMQ
- Extended by:
- FFI::Library
- Defined in:
- lib/cztop/poller/zmq.rb
Overview
CZTop’s interface to the low-level zmq_poller_*() functions.
Defined Under Namespace
Classes: PollerEvent
Constant Summary collapse
- POLLIN =
1
- POLLOUT =
2
- POLLERR =
4
Class Method Summary collapse
-
.attach_function(function_nickname, function_name, *args) ⇒ Object
Gracefully attaches a function.
Class Method Details
.attach_function(function_nickname, function_name, *args) ⇒ Object
Gracefully attaches a function. If it’s not available, this creates a placeholder class method which, when called, simply raises NotImplementedError with a helpful message.
57 58 59 60 61 62 63 64 |
# File 'lib/cztop/poller/zmq.rb', line 57 def self.attach_function(function_nickname, function_name, *args) super rescue ::FFI::NotFoundError warn "CZTop: The ZMQ function #{function_name}() is not available. Don't use CZTop::Poller." if $VERBOSE || $DEBUG define_singleton_method(function_nickname) do |*| raise NotImplementedError, 'compile ZMQ with --enable-drafts' end end |