jobs

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package jobs tracks the background jobs of one half of the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	// Ctx is the parent of the jobs; Stop cancels it.
	Ctx context.Context
	// contains filtered or unexported fields
}

Group tracks background jobs. Stopping it cancels their context and waits for them.

func New

func New() *Group

New returns a running group.

func (*Group) Start

func (g *Group) Start(f func()) bool

Start runs f in the background, tracked by Stop. It reports false, without running f, once the group is stopping.

func (*Group) Stop

func (g *Group) Stop()

Stop cancels the jobs and waits for them to finish.

Jump to

Keyboard shortcuts

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