jobs

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package jobs models the compile-time contract shared by portable job adapters. It discovers typed Job subclasses without coupling the compiler pipeline to a particular queue implementation.

Index

Constants

View Source
const (
	PackageName     = "trb/jobs"
	TypeProvider    = "trb.jobs"
	ProjectProvider = "trb.jobs.manifest"
)

Variables

This section is empty.

Functions

func Declarations

func Declarations(programs []*ast.Program) (*declaration.Catalog, error)

Types

type Job

type Job struct {
	Name            string
	ModulePath      string
	Parameters      []Parameter
	PerformKind     PerformKind
	Queue           string
	Priority        int
	MaximumAttempts int
}

func Discover

func Discover(programs []*ast.Program) ([]Job, error)

type Manifest

type Manifest struct {
	Jobs []Job
}

func Analyze

func Analyze(programs []*ast.Program, resolutions map[string]resolver.Result) (*Manifest, error)

func ManifestFrom

func ManifestFrom(extensions []ir.Extension) *Manifest

func (*Manifest) Augment

func (m *Manifest) Augment(program *ir.Program)

func (*Manifest) ExtensionName

func (*Manifest) ExtensionName() string

func (*Manifest) Job

func (m *Manifest) Job(name string) (Job, bool)

type Parameter

type Parameter struct {
	Name     string
	Type     types.Type
	WireType types.Type
}

type PerformKind added in v0.3.0

type PerformKind string
const (
	// PerformVoid is the zero value so manifests assembled by package tests and
	// third-party integrations keep the ordinary infallible Job contract.
	PerformVoid      PerformKind = ""
	PerformJobResult PerformKind = "job_result"
)

Directories

Path Synopsis
Package sqladapter owns the compile-time configuration for the official trb/jobs/sql adapter.
Package sqladapter owns the compile-time configuration for the official trb/jobs/sql adapter.
Package sqlstore defines the durable state model and dialect-specific SQL used by the portable SQL job adapter.
Package sqlstore defines the durable state model and dialect-specific SQL used by the portable SQL job adapter.

Jump to

Keyboard shortcuts

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