input

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Semaphore

type Semaphore interface {
	// 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.
	Acquire(context.Context, int64) error
	// TryAcquire acquires the semaphore with a weight of n without blocking. On
	// success, returns true. On failure, returns false and leaves the semaphore
	// unchanged.
	TryAcquire(int64) bool
	// Release releases the semaphore with a weight of n.
	Release(int64)
}

Semaphore is used by inputs to limit the number of concurrent requests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL