diff --git a/spec/helpers/tcp_gate_scheduler.rb b/spec/helpers/tcp_gate_scheduler.rb index 9d48f34d..aff25996 100644 --- a/spec/helpers/tcp_gate_scheduler.rb +++ b/spec/helpers/tcp_gate_scheduler.rb @@ -116,7 +116,7 @@ def read( transfer_until: ) # Option `transfer_until` can be (higher to lower priority): # :eof => transfer until channel is closed # :wouldblock => transfer until no immediate data is available - # IO object => transfer until IO is writeable + # IO object => transfer until IO is writable # # The method does nothing if a transfer is already pending, but might raise the transfer_until option, if the requested priority is higher than the pending transfer. def write( transfer_until: ) @@ -282,7 +282,7 @@ def io_wait(io, events, duration) conn.observed_fd = io.fileno if (events & IO::WRITABLE) > 0 - puts "write-trigger #{conn.write_fds} until #{io.fileno} writeable" + puts "write-trigger #{conn.write_fds} until #{io.fileno} writable" conn.write(transfer_until: io) if (events & IO::READABLE) > 0 @@ -292,10 +292,10 @@ def io_wait(io, events, duration) else if (events & IO::READABLE) > 0 puts "write-trigger #{conn.write_fds} until wouldblock" - # Many applications wait for writablility only in a would-block case. - # Then we get no trigger although data was written to the observed IO. - # After writing some data the caller usually waits for some answer to read. - # We take this event as a trigger to transfer of all pending written data. + # libpq waits for writablility only in a would-block case and not before writing. + # Since our incoming IO probably doesn't block, we get no write-trigger although data was written to the observed IO. + # But after writing some data the caller usually waits for some answer to read. + # We take this event as a trigger to transfer all pending written data. conn.write(transfer_until: :wouldblock) puts "read-trigger #{conn.read_fds} single block"