Class: DripDrop::ZMQBaseHandler

Inherits:
BaseHandler show all
Defined in:
lib/dripdrop/handlers/zeromq.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ZMQBaseHandler

Returns a new instance of ZMQBaseHandler.



16
17
18
19
20
# File 'lib/dripdrop/handlers/zeromq.rb', line 16

def initialize(opts={})
  @opts         = opts
  @connection   = nil
  @msg_format   = opts[:msg_format] || :dripdrop
end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



14
15
16
# File 'lib/dripdrop/handlers/zeromq.rb', line 14

def connection
  @connection
end

Instance Method Details

#addressObject



28
29
30
# File 'lib/dripdrop/handlers/zeromq.rb', line 28

def address
  self.connection.address
end

#on_recv(msg_format = :dripdrop, &block) ⇒ Object



22
23
24
25
26
# File 'lib/dripdrop/handlers/zeromq.rb', line 22

def on_recv(msg_format=:dripdrop,&block)
  @msg_format = msg_format
  @recv_cbak = block
  self
end

#post_setupObject

Triggered after a handler is setup



33
# File 'lib/dripdrop/handlers/zeromq.rb', line 33

def post_setup; end