tasks

package
v0.0.0-...-b51443a Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ResultFloat64  task flaot64 result
	ResultFloat64 = "float64"
	// ResultInt task int result
	ResultInt = "int"
)

Variables

This section is empty.

Functions

func SyncTask

func SyncTask(wg *sync.WaitGroup, timeout time.Duration, task TaskAble, outCh chan<- TaskResult)

SyncTask sync exec task

Types

type ResultType

type ResultType string

ResultType task result type

type TaskAble

type TaskAble interface {
	Name() string
	Exec()
	Result() <-chan TaskResult
}

TaskAble can do as a task

type TaskResult

type TaskResult struct {
	Result interface{}
	Type   ResultType
	Error  error
	From   string
}

TaskResult task result

func ConcurrentTasks

func ConcurrentTasks(tasks []TaskAble, timeout time.Duration) []TaskResult

ConcurrentTasks concurrent exec task and block

Jump to

Keyboard shortcuts

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