Module: CZTop::ZsockOptions
Overview
Defined Under Namespace
Classes: OptionsAccessor
Instance Method Summary collapse
-
#fd ⇒ Integer
Useful for registration in an event-loop.
-
#options ⇒ OptionsAccessor
Access to the options of this socket.
-
#readable? ⇒ Boolean
Checks whether there’s a message that can be read from the socket without blocking.
-
#to_io ⇒ IO
IO for FD.
-
#writable? ⇒ Boolean
Checks whether at least one message can be written to the socket without blocking.
Instance Method Details
#fd ⇒ Integer
Useful for registration in an event-loop.
41 42 43 |
# File 'lib/cztop/zsock_options.rb', line 41 def fd .fd end |
#options ⇒ OptionsAccessor
Access to the options of this socket.
17 18 19 |
# File 'lib/cztop/zsock_options.rb', line 17 def @options ||= OptionsAccessor.new(self) end |
#readable? ⇒ Boolean
Checks whether there’s a message that can be read from the socket without blocking.
25 26 27 |
# File 'lib/cztop/zsock_options.rb', line 25 def readable? (.events & Poller::ZMQ::POLLIN).positive? end |
#to_io ⇒ IO
Returns IO for FD.
47 48 49 |
# File 'lib/cztop/zsock_options.rb', line 47 def to_io IO.for_fd fd, autoclose: false end |