racing

package
v5.28.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sleep

func Sleep(ctx context.Context, d time.Duration) error

Types

type LockTimeoutError

type LockTimeoutError string

func (LockTimeoutError) Error

func (l LockTimeoutError) Error() string

type Mutex

type Mutex interface {
	// TryLock attempts to acquire the lock before the deadline set by the provided context
	// If the context does not define a deadline, TryLock will block until the lock is acquired
	// Returns true if the lock is acquired, false otherwise
	TryLock(ctx context.Context) bool
	// Unlock frees this lock, if locked
	// It is a run-time error if the lock is not locked on entry to Unlock.
	Unlock()
}

func NewMutex

func NewMutex() Mutex

type RacingReader

type RacingReader interface {
	Read(ctx context.Context, bytes []byte) (int, error)
	ReadFull(ctx context.Context, bytes []byte) (int, error)
}

func NewRacingReader

func NewRacingReader(reader io.Reader) RacingReader

type RacingWriter

type RacingWriter interface {
	Write(ctx context.Context, bytes []byte) (int, error)
}

func NewRacingWriter

func NewRacingWriter(writer io.Writer) RacingWriter

Jump to

Keyboard shortcuts

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