async

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MPL-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogTermination added in v1.6.0

func LogTermination(name string, logger *zap.Logger)

func Run

func Run(ctx context.Context, wg *sync.WaitGroup, f Runner)

Run runs the provided function in a goroutine, and call wg.Done() when it returns. Stopping the async function is meant to be handled by the provided context.

Types

type Operations added in v1.6.0

type Operations interface {
	Run(name string, f Runner)
	Wait()
}

func NewOperations added in v1.6.0

func NewOperations(ctx context.Context, logger *zap.Logger) Operations

type Runner

type Runner func(ctx context.Context)

Runner is a function callable by async.Run()

Jump to

Keyboard shortcuts

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