Module: DTAS::WritableIter
- Included in:
- Pipe
- Defined in:
- lib/dtas/writable_iter.rb
Overview
used to manage writable state for -player pipes
Instance Attribute Summary collapse
-
#on_writable ⇒ Object
:nodoc:.
-
#ready_write ⇒ Object
we may use the ready_write flag to avoid an extra IO.select.
Instance Method Summary collapse
- #ready_write_optimized? ⇒ Boolean
- #wait_writable_prepare ⇒ Object
-
#writable_iter ⇒ Object
this is used to exchange our own writable status for the readable status of the DTAS::Buffer which triggered us.
- #writable_iter_init ⇒ Object
Instance Attribute Details
#on_writable ⇒ Object
:nodoc:
8 9 10 |
# File 'lib/dtas/writable_iter.rb', line 8 def on_writable @on_writable end |
#ready_write ⇒ Object
we may use the ready_write flag to avoid an extra IO.select
10 11 12 |
# File 'lib/dtas/writable_iter.rb', line 10 def ready_write @ready_write end |
Instance Method Details
#ready_write_optimized? ⇒ Boolean
18 19 20 21 22 |
# File 'lib/dtas/writable_iter.rb', line 18 def ready_write_optimized? rv = @ready_write @ready_write = false rv end |
#wait_writable_prepare ⇒ Object
24 25 26 27 |
# File 'lib/dtas/writable_iter.rb', line 24 def wait_writable_prepare @ready_write = false @on_writable ||= @mark_writable end |
#writable_iter ⇒ Object
this is used to exchange our own writable status for the readable status of the DTAS::Buffer which triggered us.
31 32 33 34 35 36 37 38 |
# File 'lib/dtas/writable_iter.rb', line 31 def writable_iter if owr = @on_writable @on_writable = nil @ready_write = true owr.call # this triggers readability watching of DTAS::Buffer end :ignore end |
#writable_iter_init ⇒ Object
12 13 14 15 16 |
# File 'lib/dtas/writable_iter.rb', line 12 def writable_iter_init @mark_writable = proc { @ready_write = true } @on_writable = nil @ready_write = true end |