Documentation
¶
Overview ¶
Package runtime provides ordered execution of systems for a core phase.
Index ¶
- type Entry
- type Schedule
- func (s *Schedule) Add(entry Entry) error
- func (s *Schedule) AddAfter(target string, entry Entry) error
- func (s *Schedule) AddBefore(target string, entry Entry) error
- func (s *Schedule) AddFirst(entry Entry) error
- func (s *Schedule) AddLast(entry Entry) error
- func (s *Schedule) Run(ctx *core.Context) error
- func (s *Schedule) SetClosing(entry Entry) error
- func (s *Schedule) SetOpening(entry Entry) error
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 ¶
NewSchedule returns an empty schedule sharing group state with other schedules.
func (*Schedule) AddAfter ¶ added in v0.4.0
AddAfter inserts an entry immediately after the named regular system.
func (*Schedule) AddBefore ¶ added in v0.4.0
AddBefore inserts an entry immediately before the named regular system.
func (*Schedule) Run ¶
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
SetClosing registers the outermost closing entry.
func (*Schedule) SetOpening ¶ added in v0.4.0
SetOpening registers the outermost opening entry.