hi,
you can pause/resume file-handle watching with POE::Kernel's
select_resume_read() and select_pause_read().
Up to now Wheel::ReadWrite has no read flow control. As some people seem to
need it (me too) I patched it to include this. Attached is a modified
ReadWrite.pm and a small test program. The patch patch consists of 2 tiny
pause/resume methods, support for read buffers in the read state, and a
get method to shift values from the buffer. No more documentation or even
option value checking yet. The test code should make it clear. In buffered
mode, input events are just sent if the buffer was empty before. Records can
be read with get() by the consumer side. If the buffer is empty, the consumer
needs to wait for an input event (you can't really get rid of this). After the
first test passed, use telnet to connect to the script and drop some test
lines. I tested it a bit with this code, but nothing more. It should work,
but I need to go through the code again and check for lock-ups/races.
These patches are not part of standard POE. The author, Rocco Caputo, said
that it would be needed, but he is the one who decides what goes into the
official releases, and he doesn't have enough time to do this right now.
But it takes less time when patches are done well and carefully tested, so
please, use it :)
torvald
rwwheel_readflowctrl.tar.gz