mirror of
https://github.com/nikdoof/vsphere-influxdb-go.git
synced 2025-12-20 05:59:21 +00:00
add vendoring with go dep
This commit is contained in:
19
vendor/github.com/influxdata/influxdb/pkg/limiter/fixed.go
generated
vendored
Normal file
19
vendor/github.com/influxdata/influxdb/pkg/limiter/fixed.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// Package limiter provides concurrency limiters.
|
||||
package limiter
|
||||
|
||||
// Fixed is a simple channel-based concurrency limiter. It uses a fixed
|
||||
// size channel to limit callers from proceeding until there is a value available
|
||||
// in the channel. If all are in-use, the caller blocks until one is freed.
|
||||
type Fixed chan struct{}
|
||||
|
||||
func NewFixed(limit int) Fixed {
|
||||
return make(Fixed, limit)
|
||||
}
|
||||
|
||||
func (t Fixed) Take() {
|
||||
t <- struct{}{}
|
||||
}
|
||||
|
||||
func (t Fixed) Release() {
|
||||
<-t
|
||||
}
|
||||
Reference in New Issue
Block a user