Skip to content

furykerry/semaphore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

semaphore

Semaphore implementation in golang

Build Status GoDoc Go Report Card

Usage

Initiate

import "github.com/abiosoft/semaphore"
...
sem := semaphore.New(5) // new semaphore with 5 permits

Acquire

sem.Acquire() // one
sem.AcquireMany(n) // multiple
sem.AcquireWithin(n, time.Second * 5) // timeout after 5 sec
sem.AcquireContext(ctx, n) // acquire with context

Release

sem.Release() // one
sem.ReleaseMany(n) // multiple

documentation

http://godoc.org/github.com/abiosoft/semaphore

About

Semaphore implementation in golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%