new

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 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 Engine

type Engine[REQ, RES, V any, FUN TaskFunc[REQ, RES]] struct {
	Properties V
	// contains filtered or unexported fields
}

func NewEngineN

func NewEngineN[REQ, RES, V any, FUN TaskFunc[REQ, RES]](workerCount uint, props V, fun func(RES), failFun func(*Task[REQ, RES, FUN])) *Engine[REQ, RES, V, FUN]

func (*Engine[REQ, RES, V, FUN]) NewTaskA

func (e *Engine[REQ, RES, V, FUN]) NewTaskA(task TaskFuncA) *conctrl.Task

type Task

type Task[REQ, RES any, FUN TaskFunc[REQ, RES]] struct {
	Id   uint
	Kind conctrl.Kind
	Do   FUN[REQ, RES]
}

func NewTask

func NewTask[REQ, RES any, FUN TaskFunc[REQ, RES]](taskFun FUN) *Task[REQ, RES, FUN]

type TaskFunc

type TaskFunc[REQ, RES any] interface {
	TaskFuncA | TaskFuncB | TaskFuncC[RES] | TaskFuncD[REQ] | TaskFuncE[REQ, RES]
}

type TaskFuncA

type TaskFuncA func(context.Context)

type TaskFuncB

type TaskFuncB func(context.Context) error

type TaskFuncC

type TaskFuncC[T any] func(context.Context) (T, error)

type TaskFuncD

type TaskFuncD[T any] func(context.Context, T) error

type TaskFuncE

type TaskFuncE[REQ, RES any] func(context.Context, REQ) (RES, error)

Jump to

Keyboard shortcuts

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