locking

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string)

func Lock

func Lock(key, identifier string)

func LockWithContext

func LockWithContext(ctx context.Context, key, identifier string) error

func LockedBy

func LockedBy(key string) (string, bool)

func RegisterLocker

func RegisterLocker(lock Locker) error

func TryLock

func TryLock(key, identifier string) (ok bool)

func Unlock

func Unlock(key string, remove bool)

Types

type InstanceDeleteBackoff

type InstanceDeleteBackoff interface {
	ShouldProcess(key string) (bool, time.Time)
	Delete(key string)
	RecordFailure(key string)
}

func NewInstanceDeleteBackoff

func NewInstanceDeleteBackoff(_ context.Context) (InstanceDeleteBackoff, error)

type Locker

type Locker interface {
	TryLock(key, identifier string) bool
	Lock(key, identifier string)
	LockWithContext(ctx context.Context, key, identifier string) error
	LockedBy(key string) (string, bool)
	Unlock(key string, remove bool)
	Delete(key string)
}

func NewLocalLocker

func NewLocalLocker(_ context.Context, _ dbCommon.Store) (Locker, error)

Jump to

Keyboard shortcuts

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