Class: EventMachine::Protocols::Zmq2::PrePub

Inherits:
Socket
  • Object
show all
Includes:
PackString
Defined in:
lib/em/protocols/zmq2/pub_sub.rb

Constant Summary

Constants included from PackString

EventMachine::Protocols::Zmq2::PackString::BIG_PACK, EventMachine::Protocols::Zmq2::PackString::SMALL_PACK

Instance Method Summary collapse

Methods included from PackString

#pack_string, #prepare_message

Instance Method Details

#send_message(message, even_if_busy = false) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/em/protocols/zmq2/pub_sub.rb', line 56

def send_message(message, even_if_busy = false)
  sent = false
  prepared = prepare_message(message)
  peers = even_if_busy ? @peers : @free_peers
  for identity, peer in peers
    if !peer.error?
      peer.send_strings_or_prepared(message, prepared)
      sent = true
    end
  end
end