goroutine

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stop

type Stop func() error

Stop is a function that calling code can execute on shutdown to stop the goroutine.

func NewScheduled

func NewScheduled(tick time.Duration, action func() error, stop func() error) Stop

NewScheduled executes action on every tick. It executes action immediately when called and does not wait for the first tick to pass.

If stop isn't nil, then it is executed as part of the stop process. It allows code to clean up additional resources.

NewScheduled returns a Stop function that calling code should use to stop the goroutine and free up internal resources.

Jump to

Keyboard shortcuts

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