<@U0MEUGTCM> Semaphore is a shared mutable state. ...
# coroutines
e
@oshai Semaphore is a shared mutable state. Coroutines are about highly-concurrent code, and highly-concurrent code does not stylistically mix with shared state. You should strive to share by communicating instead of sharing mutable state and that is what the worker pool pattern is about. It does solve the same problem as semaphore (limiting the number of concurrent operations to some fixed number
n
), but in a much cleaner way.