Help us shape the future of Go! Take the 2026 Go Developer Survey

contextutil

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2017 License: MIT Imports: 3 Imported by: 0

README

contextutil

GoDoc

Package contextutil implements some context utility functions.

Documentation

Overview

Package contextutil implements some context utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultiContext

func MultiContext(ctxs ...context.Context) (context.Context, context.CancelFunc)

MultiContext creates a new context that shares state from all the given contexts. Deadline() returns the smallest Deadline() among all of the given contexts. Done() returns a channel that is closed when any of the given context's Done channels are closed and Err() returns its associated Err(). Value() returns the first non-nil value from the given contexts, in the order given.

Canceling this context releases resources associated with it, so code should call the returned cancel function as soon as the operations running in this Context complete.

Types

This section is empty.

Jump to

Keyboard shortcuts

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