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.
Click to show internal directories.
Click to hide internal directories.