slowmessage

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2017 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