parallel

package
v0.0.0-...-6442e4a Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcurrentRun

func ConcurrentRun(ctx context.Context, timeout time.Duration, tasks ...Task) []bool

ConcurrentRun run your function concurrently ConcurrentRun give up when ctx.Done() if ctx != nil timeout set timeout for run given task return done or timeout flags according to given tasks

Types

type Task

type Task struct {
	Func       func()
	Ignorable  bool
	CancelFunc func()
}

Task run by ConcurrentRun ConcurrentRun will return immediately after all unignorable tasks done CancelFun will be invoked when this task overtime. It's always context's cancel function.

Jump to

Keyboard shortcuts

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