Class: EventMachine::Protocols::Zmq2::PreRouter
- Inherits:
-
Socket
- Object
- Socket
- EventMachine::Protocols::Zmq2::PreRouter
- Defined in:
- lib/em/protocols/zmq2/router.rb
Overview
ZMQ socket which acts like Router but without outgoing message queueing. It counts first message string as peer identity when sending message and prepends socket identity to message on receiving.
Instance Method Summary collapse
- #receive_message(message) ⇒ Object
-
#receive_message_and_peer(message, peer_identity) ⇒ Object
:nodoc:.
- #send_message(message, even_if_busy = false) ⇒ Object
Instance Method Details
#receive_message(message) ⇒ Object
15 16 17 |
# File 'lib/em/protocols/zmq2/router.rb', line 15 def () raise NoMethodError end |
#receive_message_and_peer(message, peer_identity) ⇒ Object
:nodoc:
10 11 12 13 |
# File 'lib/em/protocols/zmq2/router.rb', line 10 def (, peer_identity) # :nodoc: .unshift(peer_identity) () end |
#send_message(message, even_if_busy = false) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/em/protocols/zmq2/router.rb', line 19 def (, even_if_busy = false) if connect = choose_peer(.first, even_if_busy) connect.send_strings([1..-1]) true end end |