Closed axman6 closed 5 years ago
Thanks! Only reason I rolled my own is because I wasn't aware of this; so I have no reason to believe that mine is better.
I will definitely use this; however I was thinking about also throttling localProcessBackend
as I do with lambdaBackend
; so I want to apply this change in a slightly bigger refactor where I move this module to distributed-dataset
package and expose it.
With a small API change, you could take advantage to of the pre-existing QSem type which is designed for this sort of job:
Neither way seems obviously better than the other - I use this method in amazonka-s3-streaming to limit the number of current threads.