future

package
v0.1.0-latest-stable Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Future

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

func New

func New(fn func() (any, error), cleanupFunc func() bool) *Future

func (*Future) GetResult

func (f *Future) GetResult() (any, error)

func (*Future) GetState

func (f *Future) GetState() FutureTaskState

type FutureTaskState

type FutureTaskState int
const (
	Poll FutureTaskState = iota
	Ready
)

type TaskManager

type TaskManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTaskManager

func NewTaskManager(maxRun int) *TaskManager

func (*TaskManager) Len

func (m *TaskManager) Len() int

func (*TaskManager) RunTask

func (m *TaskManager) RunTask(taskID string, f func() (any, error), cleanupFunc func() bool) (task *Future, maxReached bool)

func (*TaskManager) StartHousekeeping

func (m *TaskManager) StartHousekeeping()

Jump to

Keyboard shortcuts

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