Class: Invoker::Reactor::Reader
- Inherits:
-
Object
- Object
- Invoker::Reactor::Reader
- Defined in:
- lib/invoker/reactor/reader.rb
Instance Attribute Summary collapse
-
#read_array ⇒ Object
Returns the value of attribute read_array.
Instance Method Summary collapse
- #handle_read_event(read_ready_fds) ⇒ Object
-
#initialize ⇒ Reader
constructor
A new instance of Reader.
- #watch_for_read(socket) ⇒ Object
Constructor Details
#initialize ⇒ Reader
Returns a new instance of Reader.
5 6 7 |
# File 'lib/invoker/reactor/reader.rb', line 5 def initialize @read_array = [] end |
Instance Attribute Details
#read_array ⇒ Object
Returns the value of attribute read_array.
3 4 5 |
# File 'lib/invoker/reactor/reader.rb', line 3 def read_array @read_array end |
Instance Method Details
#handle_read_event(read_ready_fds) ⇒ Object
13 14 15 16 |
# File 'lib/invoker/reactor/reader.rb', line 13 def handle_read_event(read_ready_fds) ready_fds = read_ready_fds.flatten.compact ready_fds.each { |ready_fd| process_read(ready_fd) } end |
#watch_for_read(socket) ⇒ Object
9 10 11 |
# File 'lib/invoker/reactor/reader.rb', line 9 def watch_for_read(socket) @read_array << socket end |