lock

package
v1.1.38 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock interface {
	Generation() int64
	object.SyncOperation
}

func NewLock

func NewLock(options Options) Lock

type Options

type Options struct {
	// ExpiresAfter will delete existing locks older than this age (0 means locks will never expire)
	ExpiresAfter time.Duration
	// BackoffStartingInterval initial sleep time for backoff
	BackoffStartingInterval time.Duration
	// BackoffMultiplier how much to multiply backoff interval after each failed attempt to acquire a lock
	BackoffMultiplier float64
	// MaxWait how long to wait for a lock before timing out
	MaxWait time.Duration
}

Options configuration parameters for a Locker

type Unlock

type Unlock interface {
	object.SyncOperation
}

func NewUnlock

func NewUnlock(generation int64) Unlock

Jump to

Keyboard shortcuts

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