class CZTop::Socket::SUB
Subscribe socket for the ZeroMQ Publish-Subscribe Pattern. @see rfc.zeromq.org/spec:29
Constants
- EVERYTHING
@return [String] subscription prefix to subscribe to everything
Public Class Methods
new(endpoints = nil, subscription = nil)
click to toggle source
@param endpoints [String] endpoints to connect to @param subscription [String] what to subscribe to
# File lib/cztop/socket/types.rb, line 133 def initialize(endpoints = nil, subscription = nil) attach_ffi_delegate(Zsock.new_sub(endpoints, subscription)) end
Public Instance Methods
subscribe(prefix = EVERYTHING)
click to toggle source
Subscribes to the given prefix string. @param prefix [String] prefix string to subscribe to @return [void]
# File lib/cztop/socket/types.rb, line 143 def subscribe(prefix = EVERYTHING) ffi_delegate.set_subscribe(prefix) end
unsubscribe(prefix)
click to toggle source
Unsubscribes from the given prefix. @param prefix [String] prefix string to unsubscribe from @return [void]
# File lib/cztop/socket/types.rb, line 150 def unsubscribe(prefix) ffi_delegate.set_unsubscribe(prefix) end