runner

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TestWg is used for testing the number of check workers
	TestWg sync.WaitGroup
)

Functions

func GetCheckStats

func GetCheckStats() map[string]map[check.ID]*check.Stats

GetCheckStats returns the check stats map

func RemoveCheckStats

func RemoveCheckStats(checkID check.ID)

RemoveCheckStats removes a check from the check stats map

Types

type Runner

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

Runner ...

func NewRunner

func NewRunner() *Runner

NewRunner takes the number of desired goroutines processing incoming checks.

func (*Runner) AddWorker

func (r *Runner) AddWorker()

AddWorker adds a new worker to the worker pull

func (*Runner) GetChan

func (r *Runner) GetChan() chan<- check.Check

GetChan returns a write-only version of the pending channel

func (*Runner) SetScheduler

func (r *Runner) SetScheduler(s *scheduler.Scheduler)

SetScheduler sets the scheduler for the runner

func (*Runner) Stop

func (r *Runner) Stop()

Stop closes the pending channel so all workers will exit their loop and terminate All publishers to the pending channel need to have stopped before Stop is called

func (*Runner) StopCheck

func (r *Runner) StopCheck(id check.ID) error

StopCheck invokes the `Stop` method on a check if it's running. If the check is not running, this is a noop

func (*Runner) UpdateNumWorkers

func (r *Runner) UpdateNumWorkers(numChecks int64)

UpdateNumWorkers checks if the current number of workers is reasonable, and adds more if needed

Jump to

Keyboard shortcuts

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