Class: DripDrop::ZMQBaseHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- DripDrop::ZMQBaseHandler
- Defined in:
- lib/dripdrop/handlers/zeromq.rb
Direct Known Subclasses
ZMQPubHandler, ZMQPullHandler, ZMQPushHandler, ZMQSubHandler, ZMQXRepHandler, DripDrop::ZMQXRepHandler::Response, ZMQXReqHandler
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
Instance Method Summary collapse
- #address ⇒ Object
-
#initialize(opts = {}) ⇒ ZMQBaseHandler
constructor
A new instance of ZMQBaseHandler.
- #on_recv(msg_format = :dripdrop, &block) ⇒ Object
-
#post_setup ⇒ Object
Triggered after a handler is setup.
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
#connection ⇒ Object
Returns the value of attribute connection.
14 15 16 |
# File 'lib/dripdrop/handlers/zeromq.rb', line 14 def connection @connection end |
Instance Method Details
#address ⇒ Object
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_setup ⇒ Object
Triggered after a handler is setup
33 |
# File 'lib/dripdrop/handlers/zeromq.rb', line 33 def post_setup; end |