sema

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdWho

func CmdWho(ctx context.Context, client *clientv3.Client, name string, max int, useJSON bool) (int, error)

func RunSema

func RunSema(ctx context.Context, logger *slog.Logger, endpoints []string, dialTimeout time.Duration, ttl time.Duration, killAfter time.Duration, name string, max int, spread bool, waitLimit time.Duration, cmdArgs []string) (int, error)

Types

type SemaHolder

type SemaHolder struct {
	// contains filtered or unexported fields
}

func NewSemaHolder

func NewSemaHolder(sess *core.CoreSession, name string, max int, spread bool, val string, waitLimit time.Duration) *SemaHolder

func (*SemaHolder) Acquire

func (sh *SemaHolder) Acquire(ctx context.Context) (int64, error)

func (*SemaHolder) Key

func (sh *SemaHolder) Key() string

func (*SemaHolder) Name

func (sh *SemaHolder) Name() string

func (*SemaHolder) Release

func (sh *SemaHolder) Release(ctx context.Context) error

Jump to

Keyboard shortcuts

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