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
#bind, #connect, #listen, #receive
Constructor Details
- (Publisher) initialize(**options)
Creates a new Publisher socket.
200 201 202 |
# File 'lib/ezmq.rb', line 200 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.
213 214 215 |
# File 'lib/ezmq.rb', line 213 def send( = '', topic: '', **) @socket.send_string "#{ topic } #{ ([:encode] || @encode).call }" end |