slowmessage

package
Version: v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 11, 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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL