taskchain

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskChain

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

TaskChain manages a chain of tasks that have a parallel and serial part. The parallel part should be executed by the user specified callback and the serial part should be executed within the callback passed into the user specified callback.

func New

func New(ctx context.Context, sem *semaphore.Weighted) *TaskChain

New creates a new task chain.

func (*TaskChain) CreateTask

func (c *TaskChain) CreateTask(cb TaskChainFunc) error

CreateTask creates a new task in the task chain.

func (*TaskChain) Wait

func (c *TaskChain) Wait() error

Wait waits on the currently executing tasks to finish.

type TaskChainFunc

type TaskChainFunc = func(context.Context) (serCB func() error, err error)

TaskChainFunc is a function which is computed in parallel, and then returns a closure to be computed serially, or an error.

Jump to

Keyboard shortcuts

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