Registry / utility / marusama-semaphore-v2

marusama-semaphore-v2

JSON →
library2.5.0gogounverified

Package semaphore provides an implementation of counting semaphore primitive with possibility to change limit after creation, based on Compare-and-Swap for faster performance than channel-based implementations.

go get github.com/marusama/semaphore/v2
INSTALL
IMPORT
SIG · MARUSAMA-SEMAPHORE
M
marusama-semaphore-v2
utilitygov2.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

semaphore
github.com/marusama/semaphore/v2

Create a semaphore with limit 3, acquire one slot, then release it.

package main import ( "context" "fmt" "github.com/marusama/semaphore/v2" ) func main() { s := semaphore.New(3) s.Acquire(context.Background(), 1) fmt.Println("acquired") s.Release(1) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.5.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
marusama-semaphore-v2 — go get marusama-semaphore-v2 · libregistry