repeater

package
v3.66.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventUnknown = Event("")
	EventInit    = Event("init")
	EventTick    = Event("tick")
	EventForce   = Event("force")
	EventCancel  = Event("cancel")
)

Variables

This section is empty.

Functions

func New added in v3.11.13

func New(
	ctx context.Context,
	interval time.Duration,
	task func(ctx context.Context) (err error),
	opts ...option,
) *repeater

New creates and begins to execute task periodically.

func WithClock added in v3.26.0

func WithClock(clock clockwork.Clock) option

func WithEvent added in v3.54.0

func WithEvent(ctx context.Context, event Event) context.Context

func WithInterval added in v3.11.13

func WithInterval(interval time.Duration) option

func WithName added in v3.11.13

func WithName(name string) option

func WithTrace added in v3.11.13

func WithTrace(trace *trace.Driver) option

Types

type Event added in v3.53.0

type Event = string

func EventType added in v3.53.0

func EventType(ctx context.Context) Event

type Repeater

type Repeater interface {
	Stop()
	Force()
}

Jump to

Keyboard shortcuts

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