Clarify if `Stream.Go` blocks while the pool is full?
sudhirj opened this issue · comments
Sudhir Jonathan commented
From what I can see Stream
will block when calling Go
if the internal pool is fully occupied, just wanted to make sure this was the case, and ask for it to be documented. If we're calling it for thousands for items for example, need to know that there will be automatic back-pressure.
Camden Cheek commented
Yes, it blocks if WithMaxGoroutines
has been configured and all goroutines in the pool are already handling a task. If WithMaxGoroutines
has not been configured, the default is unlimited concurrency and it will never block. I'll add some docs for this, thanks!