There is no counting semaphore in coroutines yet r...
# coroutines
a
There is no counting semaphore in coroutines yet right? Only
Mutex
?
v
Not yet, but it is in work, PR #1101
💯 2
👏 2
a
Great, thanks!
As a FYI I’m trying to limit concurrency due to memory constraints. Was planning on using a semaphore for that
I could use a worker pool but for now that would be overkill
v
As a temporary workaround you can use
Channel<Unit>(permits)
as a semaphore
a
Right. And it would never block when putting a permit back since there doesn’t exist more permits than the buffer size
w
You can also limit work using the fan-out method