lock

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLockHasReleased  = errors.New("lock has released")
	ErrUnexpectedStatus = errors.New("unexpected status")
)

Functions

This section is empty.

Types

type DLock

type DLock interface {
	Acquire(key []byte, value []byte, callback callback.Callback[any])

	Release(cb callback.Callback[error])
}

func NewMetaLock

func NewMetaLock(ctx context.Context, metadata metadata.Metadata, options MetaLockOptions) DLock

type MetaLock

type MetaLock struct {
	*slog.Logger
	sync.Mutex
	// contains filtered or unexported fields
}

func (*MetaLock) Acquire

func (m *MetaLock) Acquire(key []byte, value []byte, cb callback.Callback[any])

func (*MetaLock) Release

func (m *MetaLock) Release(cb callback.Callback[error])

type MetaLockOptions

type MetaLockOptions struct {
	OnRelease callback.Callback[DLock]
}

Jump to

Keyboard shortcuts

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