routine

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package routine helps in starting background tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(parentCtx context.Context, routine func(context.Context)) (cancel context.CancelFunc)

Run runs the given function in a new background context. The new context inherits the logger and oauth2 authentication of the parent context. Panics thrown in the function are logged and sent to sentry. The routines context is canceled if the program receives a shutdown signal (SIGINT, SIGTERM), if the returned CancelFunc is called, or if the routine returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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