package semaphore

Import Path
	golang.org/x/sync/semaphore (on go.dev)

Dependency Relation
	imports 3 packages, and imported by one package

Involved Source Files Package semaphore provides a weighted semaphore implementation.
Package-Level Type Names (total 2, in which 1 is exported)
/* sort exporteds by: | */
Weighted provides a way to bound concurrent access to a resource. The callers can request access with a given weight. Acquire acquires the semaphore with a weight of n, blocking until resources are available or ctx is done. On success, returns nil. On failure, returns ctx.Err() and leaves the semaphore unchanged. Release releases the semaphore with a weight of n. TryAcquire acquires the semaphore with a weight of n without blocking. On success, returns true. On failure, returns false and leaves the semaphore unchanged. func NewWeighted(n int64) *Weighted
Package-Level Functions (only one, which is exported)
NewWeighted creates a new weighted semaphore with the given maximum combined weight for concurrent access.