jobs

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 10 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

Declarations derives the Jobs type-provider catalog from the versioned, declaration-only project snapshot. It never receives compiler AST nodes.

func EnqueueHelperName added in v0.3.15

func EnqueueHelperName(jobName, method string) string

EnqueueHelperName returns the compiler-reserved portable helper that owns a derived Job enqueue method's serialization and scheduling behavior.

func GenerateProject added in v0.3.15

func GenerateProject(input packageextension.ProjectDeclarationInput, entrypointModule, configurationModule string, origin packageextension.SourceSpan) (packageextension.ProjectGenerationResponse, error)

GenerateProject returns portable TypeRB source for project-wide Jobs behavior. Runtime adapters remain responsible for persistence and worker lifecycle; this source owns payload encoding, scheduling normalization, payload decoding, and typed Job dispatch.

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
	Newtype       bool
	NewtypeModule string
}

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