renderworker

package
v0.16.521 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package renderworker is `runtime render-worker`: the hub's worker that draws the design pictures of machines that are off (docs/hub/render-worker.md). It claims a job from the hub, opens the board from the hub's store at the job's address in a headless Chrome, and sends the picture back. It keeps nothing of its own: the hub holds the queue and the pictures, so any number of workers can run and any of them can die.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(args []string) error

Main is `runtime render-worker`: HUB_URL and HUB_RENDER_TOKEN from the environment (or -hub), Chrome from RUNTIME_DESIGN_CHROME or the usual places.

Types

type Worker

type Worker struct {
	Hub    string // the hub's address, without a trailing slash
	Token  string
	Shoot  shooter
	Client *http.Client
	Log    *slog.Logger
}

Worker is one worker's loop.

func (*Worker) Once

func (w *Worker) Once(ctx context.Context) (bool, error)

Once claims one job and draws it; false when the hub had none.

func (*Worker) Run

func (w *Worker) Run(ctx context.Context)

Run claims and draws until ctx ends; a hub that does not answer is asked again after a pause. A check or an export runs beside the pictures, one at a time: while it runs the worker asks for pictures only.

Jump to

Keyboard shortcuts

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