asyncx

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task[T any] struct {
	Task func() T
	// contains filtered or unexported fields
}

func NewTask

func NewTask[T any](task func() T) *Task[T]

func (*Task[T]) Async

func (a *Task[T]) Async()

func (*Task[T]) IsCompleted

func (a *Task[T]) IsCompleted() bool

func (*Task[T]) IsRunning

func (a *Task[T]) IsRunning() bool

func (*Task[T]) Result

func (a *Task[T]) Result() *T

func (*Task[T]) Wait

func (a *Task[T]) Wait() T

type WaitGroup

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

func (*WaitGroup) Add

func (wg *WaitGroup) Add(task *Task[any])

func (*WaitGroup) AddFunc

func (wg *WaitGroup) AddFunc(f func())

func (*WaitGroup) Wait

func (wg *WaitGroup) Wait()

Jump to

Keyboard shortcuts

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