Class: ZMQ::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/0mq/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(frontend, backend, capture = nil) ⇒ Proxy

Returns a new instance of Proxy.



6
7
8
9
10
# File 'lib/0mq/proxy.rb', line 6

def initialize(frontend, backend, capture = nil)
  @frontend = frontend.nil? ? nil : frontend.ptr
  @backend  = backend.nil?  ? nil : backend.ptr
  @capture  = capture.nil?  ? nil : capture.ptr
end

Instance Method Details

#runObject

Block the current thread with the event loop of the proxy



13
14
15
# File 'lib/0mq/proxy.rb', line 13

def run
  LibZMQ.zmq_proxy @frontend, @backend, @capture
end