runtime

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 2 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 runtime provides ordered execution of systems for a core phase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// Name identifies the registration in execution errors.
	Name string
	// System runs when the entry is enabled.
	System core.SystemFunc
	// Group determines the execution group for the system.
	Group string
}

Entry associates a system with its registration name and group.

type Schedule

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

Schedule runs registered systems in order for one core.Phase.

func NewSchedule

func NewSchedule(phase core.Phase, groups map[string]bool) *Schedule

NewSchedule returns an empty schedule sharing group state with other schedules.

func (*Schedule) Add

func (s *Schedule) Add(entry Entry) error

Add appends an entry to the schedule.

func (*Schedule) AddAfter added in v0.4.0

func (s *Schedule) AddAfter(target string, entry Entry) error

AddAfter inserts an entry immediately after the named regular system.

func (*Schedule) AddBefore added in v0.4.0

func (s *Schedule) AddBefore(target string, entry Entry) error

AddBefore inserts an entry immediately before the named regular system.

func (*Schedule) AddFirst added in v0.4.0

func (s *Schedule) AddFirst(entry Entry) error

AddFirst appends an entry to the first boundary.

func (*Schedule) AddLast added in v0.4.0

func (s *Schedule) AddLast(entry Entry) error

AddLast appends an entry to the last boundary.

func (*Schedule) Run

func (s *Schedule) Run(ctx *core.Context) error

Run executes each system in order. Systems added during a run take effect on the next run. It stops at the first error and returns it with the phase and name.

func (*Schedule) SetClosing added in v0.4.0

func (s *Schedule) SetClosing(entry Entry) error

SetClosing registers the outermost closing entry.

func (*Schedule) SetOpening added in v0.4.0

func (s *Schedule) SetOpening(entry Entry) error

SetOpening registers the outermost opening entry.

Jump to

Keyboard shortcuts

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