Class: Bundesstrasse::SubSocket

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Socket

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

Methods included from Errors

#errno, #error_check, #error_string

Constructor Details

This class inherits a constructor from Bundesstrasse::Socket

Class Method Details

.typeObject



46
47
48
# File 'lib/bundesstrasse/sockets.rb', line 46

def self.type
  ZMQ::SUB
end

Instance Method Details

#subscribe(topic) ⇒ Object



50
51
52
# File 'lib/bundesstrasse/sockets.rb', line 50

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

#unsubscribe(topic) ⇒ Object



54
55
56
# File 'lib/bundesstrasse/sockets.rb', line 54

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