limiter - ActiveState ActiveGo 1.8

Package limiter

import ""

Overview ▾

Package limiter provides concurrency limiters.

type Fixed

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

func NewFixed(limit int) Fixed

func (Fixed) Release

func (t Fixed) Release()

func (Fixed) Take

func (t Fixed) Take()