On 5 Sep 2019, at 12:06, Dan Sommers <2QdxY4RzWzUUiLuE@potatochowder.com> wrote:
Yes, you need some way to produce "back pressure" from downstream to upstream, and to stop making new work (with new memory consumption) until there's a place to put it.
It seems that this is the important idea. How does the back pressure work in different use cases. 1) I don't care. Just add items to the queue. (The current API?) 2) I can be blocked when the queue is at a limit. Need an API to allows the block to happen and resumes the code when there is space in the queue. 3) I cannot be blocked as this is async code, but I need a bound on the queue. Maybe call "queue has space" callback when the queue has space? Maybe submit returns an "queue full" status? I have needed all 3 uses cases. Barry