Hi, Following the discussion on the python-tulip group, I'd like to propose a patch for the documentation of StreamWriter.drain(). This patch aims to give a better description of what drain() is intended to do, and when to use it. In particular, it highlights the fact that calling drain() does not mean that any write operation will be performed, nor is required to be called.
IMO we should mention the write buffer limits ("high- and low-water limits for write flow control"). get_write_buffer_limits() and set_write_buffer_limits() methods of the transport are public, there is no reason to "hide" them.
Here is an other patch which mentions high and low water limits. I think it's better to talk about it, since it tells extactly what a "full buffer" and "partially drained" means. On the other hand, StreamWriter wraps the transport but does not expose the set/get_write_buffer_limits() directly, you reach then through stream_writer.transport (which makes sense, StreamWriter is here to help writing, not to do plumbery) - so I did not mention the functions.