contexts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0 package contexts provide extra context implementations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actuator

type Actuator struct {
	// HeartBeat extends the context life time by the value the context was created with
	HeartBeat     func()
	HeartBeatStop func()
}

Actuator allows operating with a heartbeatable context

func WithHeartBeat

func WithHeartBeat(parent context.Context, timeout time.Duration, lg log.Entry) (context.Context, Actuator)

WithHeartBeat with return a context that is automatically cancelled if the HeartBeat function from the returned Actuator is not invoked periodically before the passed timeout expires.

Jump to

Keyboard shortcuts

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