mysync

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distribute

func Distribute[S ~[]E, E any](items S, limit int, fn func(group int, step int, subitems S) error) error

func Map added in v0.4.0

func Map[S ~[]E, E, R any](items S, limit int, out []R, fn func(subitems S) (R, error)) ([]R, error)

Types

type Mutex added in v0.4.0

type Mutex[T any] struct {
	// contains filtered or unexported fields
}

func NewMutex added in v0.4.0

func NewMutex[T any](v T) *Mutex[T]

func (*Mutex[T]) Lock added in v0.4.0

func (mu *Mutex[T]) Lock() (T, MutexUnlock)

func (*Mutex[T]) RLock added in v0.4.0

func (mu *Mutex[T]) RLock() (T, MutexRUnlock)

type MutexRUnlock added in v0.4.0

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

func (MutexRUnlock) RUnlock added in v0.4.0

func (u MutexRUnlock) RUnlock()

type MutexUnlock added in v0.4.0

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

func (MutexUnlock) Unlock added in v0.4.0

func (u MutexUnlock) Unlock()

type Pool added in v0.4.0

type Pool[T any] struct {
	// contains filtered or unexported fields
}

func NewPool added in v0.4.0

func NewPool[T any](fn func() T) *Pool[T]

func (*Pool[T]) Get added in v0.4.0

func (p *Pool[T]) Get() T

func (*Pool[T]) Put added in v0.4.0

func (p *Pool[T]) Put(v T)

Jump to

Keyboard shortcuts

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