waitctx

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOne

func AddOne(ctx context.Context)

func Done

func Done(ctx context.Context)

func FromContext

func FromContext(ctx context.Context) context.Context

func Go

func Go(ctx context.Context, fn func())

Go runs the given function in a background goroutine, and adds it to the WaitContext. Shorthand for the following pattern:

waitctx.AddOne(ctx)
go func() {
  defer waitctx.Done(ctx)
  // do stuff
}()

func Wait

func Wait(ctx context.Context, notifyAfter ...time.Duration)

Types

This section is empty.

Jump to

Keyboard shortcuts

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