Module: OMQ::FFI
- Defined in:
- lib/omq/ffi/engine.rb,
lib/omq/ffi/libzmq.rb
Defined Under Namespace
Modules: Libzmq Classes: Engine
Class Method Summary collapse
-
.context ⇒ FFI::Pointer
Returns the shared ZMQ context (one per process, lazily initialized).
Class Method Details
.context ⇒ FFI::Pointer
Returns the shared ZMQ context (one per process, lazily initialized).
631 632 633 634 635 636 637 638 639 |
# File 'lib/omq/ffi/engine.rb', line 631 def self.context @context ||= Libzmq.zmq_ctx_new.tap do |ctx| raise "zmq_ctx_new failed" if ctx.null? at_exit do Libzmq.zmq_ctx_shutdown(ctx) rescue nil Libzmq.zmq_ctx_term(ctx) rescue nil end end end |