add vendoring with go dep

This commit is contained in:
Adrian Todorov
2017-10-25 20:52:40 +00:00
parent 704f4d20d1
commit a59409f16b
1627 changed files with 489673 additions and 0 deletions

View 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
}