farmstatus

package
v0.0.0-...-1ac1dea Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

package farmstatus provides a status indicator for the entire Flamenco farm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

type EventBus interface {
	AddListener(listener eventbus.Listener)
	BroadcastFarmStatusEvent(event api.EventFarmStatus)
}

type PersistenceService

type PersistenceService interface {
	SummarizeJobStatuses(ctx context.Context) (persistence.JobStatusCount, error)
	SummarizeWorkerStatuses(ctx context.Context) (persistence.WorkerStatusCount, error)
}

type Service

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

Service keeps track of the overall farm status.

func NewService

func NewService(persist PersistenceService, eventbus EventBus) *Service

NewService returns a 'farm status' service. Run its Run() function in a goroutine to make it actually do something.

func (*Service) OnEvent

func (s *Service) OnEvent(topic eventbus.EventTopic, payload interface{})

func (*Service) Report

func (s *Service) Report() api.FarmStatusReport

Report returns the last-known farm status report.

It is updated every few seconds, from the Run() function.

func (*Service) Run

func (s *Service) Run(ctx context.Context)

Run the farm status polling loop.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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