slowmessage

package
v0.0.0-...-d0ab2d1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(threshold time.Duration, sf SlowFunc, cb CallbackFunc) error

Do calls sf. If threshold time has passed, cb is called. Note that this call will be made concurrently to sf still running.

Types

type CallbackFunc

type CallbackFunc func()

CallbackFunc is the function that is triggered when the threshold is reached.

type SlowFunc

type SlowFunc func() error

SlowFunc is the function that could be slow. Usually, you'll have to wrap an existing function in a lambda to make it match this type signature.

Jump to

Keyboard shortcuts

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