converger

package
v0.0.0-...-a5247d6 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package converger is a facility for reporting the converged state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converger

type Converger interface {
	Register() UID
	IsConverged(UID) bool         // is the UID converged ?
	SetConverged(UID, bool) error // set the converged state of the UID
	Unregister(UID)
	Start()
	Pause()
	Loop(bool)
	ConvergedTimer(UID) <-chan time.Time
	Status() map[uint64]bool
	Timeout() int                // returns the timeout that this was created with
	SetStateFn(func(bool) error) // sets the stateFn
}

Converger is the general interface for implementing a convergence watcher.

func NewConverger

func NewConverger(timeout int, stateFn func(bool) error) Converger

NewConverger builds a new converger struct.

type UID

type UID interface {
	ID() uint64   // get Id
	Name() string // get a friendly name
	SetName(string)
	IsValid() bool // has Id been initialized ?
	InvalidateID() // set Id to nil
	IsConverged() bool
	SetConverged(bool) error
	Unregister()
	ConvergedTimer() <-chan time.Time
	StartTimer() (func() error, error) // cancellable is the same as StopTimer()
	ResetTimer() error                 // resets counter to zero
	StopTimer() error
}

UID is the interface resources can use to notify with if converged. You'll need to use part of the Converger interface to Register initially too.

Jump to

Keyboard shortcuts

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