Class: Bundesstrasse::SubSocket

Inherits:
Socket
  • Object
show all
Defined in:
lib/bundesstrasse/socket.rb

Instance Method Summary collapse

Methods inherited from Socket

#bind, #close!, #connect, #connected?, #initialize, #more_parts?, #pointer, #read, #read_multipart, #read_nonblocking, #write, #write_multipart, #write_nonblocking

Methods included from Errors

#errno, #error_check, #error_string

Constructor Details

This class inherits a constructor from Bundesstrasse::Socket

Instance Method Details

#subscribe(topic) ⇒ Object



92
93
94
# File 'lib/bundesstrasse/socket.rb', line 92

def subscribe(topic)
  error_check { @socket.setsockopt(ZMQ::SUBSCRIBE, topic) }
end

#unsubscribe(topic) ⇒ Object



96
97
98
# File 'lib/bundesstrasse/socket.rb', line 96

def unsubscribe(topic)
  error_check { @socket.setsockopt(ZMQ::UNSUBSCRIBE, topic) }
end