sync

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyedMutex

type KeyedMutex struct {
	// contains filtered or unexported fields
}

KeyedMutex is a mutex that locks on a key.

func (*KeyedMutex) Lock

func (m *KeyedMutex) Lock(key string) func()

Lock locks the mutex for the given key.

type KeyedMutexItem

type KeyedMutexItem struct {
	// contains filtered or unexported fields
}

KeyedMutexItem is an item in a KeyedMutex.

type Once

type Once struct {
	// contains filtered or unexported fields
}

Once is an object that will perform exactly one action. Different from sync.Once, this implementation allows the once function to return an error, that doesn't update the done flag.

func (*Once) Do

func (o *Once) Do(f func() error) error

Do calls the function f if and only if Do is being called for the first time for this instance of Once

Jump to

Keyboard shortcuts

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