sessionlock

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sessionlock provides context-aware keyed mutual exclusion for session-scoped runner operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

type Locker[K comparable] struct {
	// contains filtered or unexported fields
}

Locker serializes operations by key while allowing different keys to proceed independently.

func New

func New[K comparable]() *Locker[K]

New creates an empty keyed Locker.

func (*Locker[K]) Lock

func (l *Locker[K]) Lock(ctx context.Context, key K) (func(), error)

Lock acquires the lock for key. Waiting stops when ctx is canceled. The returned unlock function is safe to call more than once.

Jump to

Keyboard shortcuts

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