reloader

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reloader

type Reloader[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](
	generator func(context.Context) <-chan T,
	handler func(T),
) *Reloader[T]

func (*Reloader[T]) Reset

func (h *Reloader[T]) Reset()

Reset worker this is blocking by design if you want to ask worker to reset use ResetTimeout.

func (*Reloader[T]) ResetTimeout

func (h *Reloader[T]) ResetTimeout(d ...time.Duration) bool

ResetTimeout receives a time.Duration d and waits for given time trying to reset the worker. default value is a Millisecond

func (*Reloader[T]) Start

func (h *Reloader[T]) Start(ctx context.Context)

Start worker (has exclusive locking) and must be run in a goroutine.

func (*Reloader[T]) Stop

func (h *Reloader[T]) Stop()

Stop the handler.

Jump to

Keyboard shortcuts

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