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: '', **options)
Sends a message on the socket, with an optional topic.
Methods inherited from Socket
Constructor Details
- (Publisher) initialize(**options)
Creates a new Publisher socket.
186 187 188 |
# File 'lib/ezmq.rb', line 186 def initialize(**) super :bind, ZMQ::PUB, end |
Instance Method Details
- (Fixnum) send(message = '', topic: '', **options)
Sends a message on the socket, with an optional topic.
199 200 201 |
# File 'lib/ezmq.rb', line 199 def send( = '', topic: '', **) @socket.send_string "#{ topic } #{ ([:encode] || @encode).call }" end |