module CZTop::PolymorphicZsockMethods

These are methods that can be used on a {Socket} as well as an {Actor}. @see api.zeromq.org/czmq3-0:zsock

Public Instance Methods

set_unbounded() click to toggle source

Set socket to use unbounded pipes (HWM=0); use this in cases when you are totally certain the message volume can fit in memory.

# File lib/cztop/polymorphic_zsock_methods.rb, line 27
def set_unbounded
  ::CZMQ::FFI::Zsock.set_unbounded(ffi_delegate)
end
signal(status = 0) click to toggle source

Sends a signal. @param status [Integer] signal (0-255)

# File lib/cztop/polymorphic_zsock_methods.rb, line 10
def signal(status = 0)
  ::CZMQ::FFI::Zsock.signal(ffi_delegate, status)
end
wait() click to toggle source

Waits for a signal. @return [Integer] the received signal @note This will block and is therefore not compatible with {Fiber.scheduler} (e.g. Async).

# File lib/cztop/polymorphic_zsock_methods.rb, line 18
def wait
  fail NotImplementedError if !Fiber.blocking?

  ::CZMQ::FFI::Zsock.wait(ffi_delegate)
end