class CZTop::Socket::ROUTER
Router socket for the ZeroMQ Request-Reply Pattern. @see rfc.zeromq.org/spec:28
Public Class Methods
new(endpoints = nil)
click to toggle source
@param endpoints [String] endpoints to bind to
Calls superclass method
CZTop::Socket::new
# File lib/cztop/socket/types.rb, line 142 def initialize(endpoints = nil) super attach_ffi_delegate(Zsock.new_router(endpoints)) end
Public Instance Methods
send_to(receiver, message)
click to toggle source
Send a message to a specific receiver. This is a shorthand for when you send a message to a specific receiver with no hops in between. @param receiver [String] receiving peer’s socket identity @param message [Message] the message to send @note Do NOT use the message afterwards. It’ll have been modified and
destroyed.
# File lib/cztop/socket/types.rb, line 155 def send_to(receiver, message) message = Message.coerce(message) message.prepend '' # separator frame message.prepend receiver # receiver envelope self << message end