Class: CZTop::Socket::DISH
- Inherits:
-
CZTop::Socket
- Object
- CZTop::Socket
- CZTop::Socket::DISH
- Defined in:
- lib/cztop/socket/types.rb
Overview
Group-based pub/sub (vs topic-based). This is the subscriber socket.
Constant Summary
Constants inherited from CZTop::Socket
Constants included from CZTop::SendReceiveMethods
CZTop::SendReceiveMethods::FD_TIMEOUT, CZTop::SendReceiveMethods::JIFFY
Instance Attribute Summary
Attributes inherited from CZTop::Socket
Attributes included from HasFFIDelegate
Instance Method Summary collapse
-
#initialize(endpoints = nil) ⇒ DISH
constructor
A new instance of DISH.
-
#join(group) ⇒ void
Joins the given group.
-
#leave(group) ⇒ void
Leaves the given group.
Methods inherited from CZTop::Socket
#CURVE_client!, #CURVE_server!, #bind, #close, #connect, #disconnect, #inspect, #last_endpoint, new_by_type, #unbind
Methods included from HasFFIDelegate::ClassMethods
#ffi_delegate, #from_ffi_delegate
Methods included from PolymorphicZsockMethods
#set_unbounded, #signal, #wait
Methods included from CZTop::SendReceiveMethods
#<<, #read_timeout, #receive, #wait_for_fd_signal, #wait_writable, #write_timeout
Methods included from ZsockOptions
#fd, #options, #readable?, #to_io, #writable?
Methods included from HasFFIDelegate
#attach_ffi_delegate, #from_ffi_delegate, raise_zmq_err, #to_ptr
Constructor Details
#initialize(endpoints = nil) ⇒ DISH
Returns a new instance of DISH.
315 316 317 318 319 |
# File 'lib/cztop/socket/types.rb', line 315 def initialize(endpoints = nil) super attach_ffi_delegate(Zsock.new_dish(endpoints)) end |
Instance Method Details
#join(group) ⇒ void
This method returns an undefined value.
Joins the given group.
328 329 330 331 |
# 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) ⇒ void
This method returns an undefined value.
Leaves the given group.
339 340 341 342 |
# 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 |