[If this were Gnome glib, I would create a GSource object that would be called each time before gnome glib's event loop blocked on select.]
Here is what I am trying to accomplish with asyncio that as an asyncio noob I don't yet know how to do:
I need to integrate with a transport object over which I have no source code influence. The transport maintains a write buffer from which it sends data via TCP/IP whenever its socket is writable. The transport is integrated with asyncio, so it only makes progress in the context of asyncio's event loop. The transport exposes the method get_write_buffer_size().
I need to create either an async future or coroutine (or something else that will efficiently accomplish the task) on which I can call loop.run_until() that would cause the loop.run_until() call to return as soon as possible after the transport's write buffer empties out (i.e., transport.get_write_buffer_size() returns to 0).
How can the above be accomplished efficiently and "asyncionically"?
Thank you, Vitaly