poller

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Poller

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

Poller polls the source periodically and broadcasts the received IP address message to subscribers.

Poller implements producer.Source and producer.Producer.

func New

func New(interval time.Duration, source producer.Source, logger *tslog.Logger) *Poller

New creates a new Poller.

func (*Poller) Run

func (p *Poller) Run(ctx context.Context)

Run starts the polling process. It logs errors and stops when the context is canceled.

Run implements producer.Producer.Run.

func (*Poller) Snapshot

func (p *Poller) Snapshot(ctx context.Context) (producer.Message, error)

Snapshot exposes the inner source's Snapshot method.

Snapshot implements producer.Source.Snapshot.

func (*Poller) Subscribe

func (p *Poller) Subscribe() <-chan producer.Message

Subscribe returns a channel for receiving updates on IP address changes.

Subscribe implements producer.Producer.Subscribe.

Jump to

Keyboard shortcuts

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