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

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.


53
54
55
56
57
58
59
60
61
62
# File 'lib/cztop/poller/zmq.rb', line 53

def self.attach_function(function_nickname, function_name, *args)
  super
rescue ::FFI::NotFoundError
  if $VERBOSE || $DEBUG
    warn "CZTop: The ZMQ function #{function_name}() is not available. Don't use CZTop::Poller."
  end
  define_singleton_method(function_nickname) do |*|
    raise NotImplementedError, "compile ZMQ with --enable-drafts"
  end
end