Class: EZMQ::Publisher
Overview
Publish socket that broadcasts messages with an optional topic.
Instance Attribute Summary
Attributes inherited from Socket
#context, #decode, #encode, #socket
Instance Method Summary (collapse)
-
- (Publisher) initialize(**options)
constructor
Creates a new Publisher socket.
-
- (Fixnum) send(message = '', topic: '', encode: @encode)
Sends a message on the socket, with an optional topic.
Methods inherited from Socket
Constructor Details
- (Publisher) initialize(**options)
Creates a new Publisher socket.
153 154 155 |
# File 'lib/ezmq.rb', line 153 def initialize(**) super :bind, ZMQ::PUB, end |
Instance Method Details
- (Fixnum) send(message = '', topic: '', encode: @encode)
Sends a message on the socket, with an optional topic.
165 166 167 |
# File 'lib/ezmq.rb', line 165 def send( = '', topic: '', encode: @encode) @socket.send_string "#{ topic } #{ encode.call }" end |