import "github.com/andy2046/gopie/pkg/semaphore"
Package semaphore provides a semaphore implementation.
type ISemaphore interface {
Acquire(context.Context) error
Release(context.Context) error
}
ISemaphore is the semaphore interface.
func New(n int) ISemaphore
New creates a new semaphore with given maximum concurrent access.
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore is the semaphore implementation.
func (s *Semaphore) Acquire(ctx context.Context) error
Acquire acquires the semaphore.
func (s *Semaphore) Release(ctx context.Context) error
Release releases the semaphore.
Generated by godoc2md