package
Version:
v2.0.0-beta+incompatible
Opens a new window with list of versions in this module.
Published: Dec 12, 2019
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package semaphore provides an implementation of a counting semaphore.
type Semaphore chan struct{}
Semaphore is a buffered channel based implementation of a counting
semaphore.
New creates a Semaphore with the specified number of permits.
Acquire acquires a permit. This call will block until a permit is available
or the provided context is completed.
If the provided context is completed, the method will return the
cancellation error.
Release releases a permit.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.