Class: LibZMQ::PollItem

Inherits:
FFI::Struct
  • Object
show all
Includes:
PollItemLayout
Defined in:
lib/ffi-rzmq/wrapper.rb

Overview

module PollItemLayout

Instance Method Summary collapse

Methods included from PollItemLayout

included

Instance Method Details

#both_accessible?Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/ffi-rzmq/wrapper.rb', line 110

def both_accessible?
  readable? && writable?
end

#inspectObject



114
115
116
# File 'lib/ffi-rzmq/wrapper.rb', line 114

def inspect
  "socket [#{socket}], fd [#{self[:fd]}], events [#{self[:events]}], revents [#{self[:revents]}]"
end

#readable?Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/ffi-rzmq/wrapper.rb', line 102

def readable?
  (self[:revents] & ZMQ::POLLIN) > 0
end

#socketObject



100
# File 'lib/ffi-rzmq/wrapper.rb', line 100

def socket() self[:socket]; end

#to_sObject



118
# File 'lib/ffi-rzmq/wrapper.rb', line 118

def to_s; inspect; end

#writable?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'lib/ffi-rzmq/wrapper.rb', line 106

def writable?
  (self[:revents] & ZMQ::POLLOUT) > 0
end