task

package
v0.0.0-...-ee9d8c9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 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 AtomicFloat32

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

func NewF32

func NewF32(value float32) *AtomicFloat32

func (*AtomicFloat32) Get

func (f *AtomicFloat32) Get() float32

func (*AtomicFloat32) Set

func (f *AtomicFloat32) Set(p float32)

type AtomicFloat64

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

func NewF64

func NewF64(value float64) *AtomicFloat64

func (*AtomicFloat64) Get

func (m *AtomicFloat64) Get() float64

Returns the atomic float value

func (*AtomicFloat64) Set

func (m *AtomicFloat64) Set(p float64)

Set the atomic float value

type BaseTask

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

Simple implementation of Task that can be used as a base for more

func NewBaseTask

func NewBaseTask() *BaseTask

func (*BaseTask) Done

func (t *BaseTask) Done() <-chan struct{}

func (*BaseTask) Err

func (t *BaseTask) Err() error

func (*BaseTask) Fail

func (t *BaseTask) Fail(err error) Void

func (*BaseTask) Ok

func (t *BaseTask) Ok(v any) Void

func (*BaseTask) Value

func (t *BaseTask) Value() any

type Progressive

type Progressive interface {
	GetProgress() float64
}

type Task

type Task interface {
	Value() any
	// Done returns a channel that is closed when the task is complete, either
	// with a result or an error.
	Done() <-chan struct{}
	//
	Err() error
}

type Void

type Void any

Denotes a function that will always return nil, but has a return for implementor convenience.

Jump to

Keyboard shortcuts

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