reindex

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	SetPostBuildCallback(func())
}

Builder can tell us when a build takes place.

type Scheduler

type Scheduler struct {
	*Throttler
	// contains filtered or unexported fields
}

Scheduler periodically updates the Spack buildcache index.

func NewScheduler

func NewScheduler(conf *config.Config, builder Builder) *Scheduler

NewScheduler returns a scheduler that can update the Spack buildcache index periodically.

type Throttler

type Throttler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Throttler lets you run a function limited to certain times.

func NewThrottle

func NewThrottle(op func(), period time.Duration, requiresSignal bool) *Throttler

NewThrottle returns a Throttler. Setting requiresSignal to true means that you must call Signal() for op to be run in the next period.

func (*Throttler) Signal

func (t *Throttler) Signal()

Signal allows our op to be run when the next period starts, if we were configured with requiresSignal.

func (*Throttler) Start

func (t *Throttler) Start()

Start starts running our op every one of our periods, but not if the function is still running, and optionally only if a signal has been received.

func (*Throttler) Stop

func (t *Throttler) Stop()

Stop stops us doing any further runs of our op, but doesn't stop any ongoing run.

Jump to

Keyboard shortcuts

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