Module: EventMachine::Protocols::Zmq2::RepMixin
Overview
mixin which transforms PreRouter
to PreRep
and Router
to Rep
Instance Method Summary collapse
-
#receive_message(message) ⇒ Object
you should not override
#receive_message
inPreRep
andRep
see#receive_request
instead. -
#receive_request(message, envelope) ⇒ Object
callback on incoming message, splits message and envelope use envelope later in
#send_reply
. -
#send_reply(message, envelope) ⇒ Object
joins message and envelope into single message and sends it.
Instance Method Details
#receive_message(message) ⇒ Object
you should not override #receive_message
in PreRep
and Rep
see #receive_request
instead
10 11 12 13 |
# File 'lib/em/protocols/zmq2/rep.rb', line 10 def () envelope, = () receive_request(, envelope) end |
#receive_request(message, envelope) ⇒ Object
callback on incoming message, splits message and envelope use envelope later in #send_reply
17 18 19 |
# File 'lib/em/protocols/zmq2/rep.rb', line 17 def receive_request(, envelope) raise NoMethodError end |
#send_reply(message, envelope) ⇒ Object
joins message and envelope into single message and sends it
22 23 24 |
# File 'lib/em/protocols/zmq2/rep.rb', line 22 def send_reply(, envelope) ([*envelope, EMPTY, *]) end |