poller

package
v0.0.0-...-6789dc4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 9 Imported by: 1

Documentation

Overview

Package poller implements Poller, a thing that uses (hw) alarms to wake the device up from deep sleep periodically, check for notifications, and poke polld.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnconfigured   = errors.New("not configured")
	ErrAlreadyStarted = errors.New("already started")
	ErrNotStarted     = errors.New("not started")
)

Functions

This section is empty.

Types

type Poller

type Poller interface {
	IsConnected() bool
	Start() error
	Run() error
	HasConnectivity(bool)
}

func New

func New(setup *PollerSetup) Poller

type PollerSetup

type PollerSetup struct {
	Times              Times
	Log                logger.Logger
	SessionStateGetter stater
}

type Times

type Times struct {
	AlarmInterval      time.Duration
	SessionStateSettle time.Duration
	NetworkWait        time.Duration
	PolldWait          time.Duration
	DoneWait           time.Duration
	BusyWait           time.Duration
}

Jump to

Keyboard shortcuts

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