package repeater

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/repeater"

Index

Constants

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

Functions

func New

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

func WithClock(clock clockwork.Clock) option

func WithEvent

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

func WithInterval

func WithInterval(interval time.Duration) option

func WithName

func WithName(name string) option

func WithTrace

func WithTrace(trace *trace.Driver) option

Types

type Event

type Event = string

func EventType

func EventType(ctx context.Context) Event

type Repeater

type Repeater interface {
	Stop()
	Force()
}

Source Files

repeater.go

Version
v3.59.3
Published
Mar 24, 2024
Platform
linux/amd64
Imports
7 packages
Last checked
4 minutes ago

Tools for package owners.