Class: BZMQ::SubSocket
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SubSocket
constructor
A new instance of SubSocket.
- #subscribe(topic) ⇒ Object
- #unsubscribe(topic) ⇒ Object
Methods inherited from Socket
#bind, #close, #connect, #read, #write
Constructor Details
#initialize(options = {}) ⇒ SubSocket
Returns a new instance of SubSocket.
46 47 48 |
# File 'lib/bzmq/sockets.rb', line 46 def initialize(={}) super(ZMQ::SUB, ) end |
Instance Method Details
#subscribe(topic) ⇒ Object
50 51 52 |
# File 'lib/bzmq/sockets.rb', line 50 def subscribe(topic) error_check { @socket.setsockopt(::ZMQ::SUBSCRIBE, topic) } end |
#unsubscribe(topic) ⇒ Object
54 55 56 |
# File 'lib/bzmq/sockets.rb', line 54 def unsubscribe(topic) error_check { @socket.setsockopt(::ZMQ::UNSUBSCRIBE, topic) } end |