controlplane

package
v0.0.0-...-d425aa1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Poll

type Poll struct {
	// contains filtered or unexported fields
}

func (*Poll) Stop

func (c *Poll) Stop() error

Stop stops the poller. That means no more events will be emitted. After calling stop, the poller cannot be used again.

func (*Poll) Subscribe

func (c *Poll) Subscribe(ctx context.Context, handler func())

type Poller

type Poller interface {
	// Subscribe subscribes to the poller with a handler function that will be invoked
	// Must only be called once. If the handler is busy during a tick, the next tick will be skipped.
	Subscribe(ctx context.Context, handler func())
	// Stop stops the poller. That means no more events will be emitted.
	Stop() error
}

func NewPoll

func NewPoll(interval time.Duration) Poller

NewPoll creates a new poller that emits events at the given interval and executes the given handler function in a separate goroutine.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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