class CZTop::Socket::DISH

Group-based pub/sub (vs topic-based). This is the subscriber socket. @see github.com/zeromq/libzmq/pull/1727

Public Class Methods

new(endpoints = nil) click to toggle source

@param endpoints [String] endpoints to connect to

Calls superclass method CZTop::Socket::new
# File lib/cztop/socket/types.rb, line 315
def initialize(endpoints = nil)
  super

  attach_ffi_delegate(Zsock.new_dish(endpoints))
end

Public Instance Methods

join(group) click to toggle source

Joins the given group. @param group [String] group to join, up to 15 characters @return [void] @raise [ArgumentError] when group name is invalid or group has already

been joined before

@raise [SystemCallError] in case of failure

# File lib/cztop/socket/types.rb, line 328
def join(group)
  rc = ffi_delegate.join(group)
  raise_zmq_err(format('unable to join group %p', group)) if rc == -1
end
leave(group) click to toggle source

Leaves the given group. @param group [String] group to leave @return [void] @raise [ArgumentError] when group wasn’t joined before @raise [SystemCallError] in case of another failure

# File lib/cztop/socket/types.rb, line 339
def leave(group)
  rc = ffi_delegate.leave(group)
  raise_zmq_err(format('unable to leave group %p', group)) if rc == -1
end