concurrency

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContextCheck

func WithContextCheck(ctx context.Context, action func() error) error

Types

type Future added in v1.1.0

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

func NewFuture added in v1.1.0

func NewFuture[T any](valCh <-chan T) Future[T]

func (Future[T]) Get added in v1.1.0

func (f Future[T]) Get() T

type FutureError added in v1.1.0

type FutureError = Future[error]

type Promise added in v1.1.0

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

func NewPromise added in v1.1.0

func NewPromise[T any]() Promise[T]

func (*Promise[T]) Future added in v1.1.0

func (p *Promise[T]) Future() Future[T]

func (*Promise[T]) Set added in v1.1.0

func (p *Promise[T]) Set(v T)

type PromiseError added in v1.1.0

type PromiseError = Promise[error]

type Semaphore

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

func NewSemaphore

func NewSemaphore(n int) *Semaphore

func (*Semaphore) Acquire

func (s *Semaphore) Acquire()

func (*Semaphore) Release

func (s *Semaphore) Release()

func (*Semaphore) TryAcquire

func (s *Semaphore) TryAcquire() bool

Jump to

Keyboard shortcuts

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