Marc Knaup
10/08/2020, 10:06 PMZach Klippenstein (he/him) [MOD]
10/08/2020, 10:20 PMMarc Knaup
10/08/2020, 10:38 PMDominaezzz
10/08/2020, 10:42 PMSemaphore
and acquire permits to limit concurrency.Marc Knaup
10/08/2020, 11:01 PMZach Klippenstein (he/him) [MOD]
10/08/2020, 11:04 PMMarc Knaup
10/08/2020, 11:05 PMMarc Knaup
10/08/2020, 11:53 PMMarc Knaup
10/08/2020, 11:57 PMMarc Knaup
10/08/2020, 11:58 PMCloseable
.spand
10/09/2020, 7:30 AMDominaezzz
10/09/2020, 8:24 AMSo I would have to “hot-swap” them if I want to change the permit count?No you would just have an high initial permit count like
Semaphore(100)
. Then if you want to limit concurrency by 15, call acquire
85 times, and adjust concurrency by releasing and acquiring permits.
(Unless I misunderstand what you mean by "hot-swap")Dominaezzz
10/09/2020, 8:29 AMSemaphore
is fair, you might want to acquire permits concurrently.Marc Knaup
10/09/2020, 9:19 AM