(no title)
sa46 | 4 months ago
One problem with using a channel as a semaphore is you need to track if you've closed the channel when "releasing".
https://pkg.go.dev/golang.org/x/sync/semaphore#Weighted.Acqu...
sa46 | 4 months ago
One problem with using a channel as a semaphore is you need to track if you've closed the channel when "releasing".
https://pkg.go.dev/golang.org/x/sync/semaphore#Weighted.Acqu...
themafia|4 months ago
There is where you can use a function that captures the channel and guarantees that no matter how many times it is called that it only closes the channel once.
tonymet|4 months ago