deferred

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 0 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 deferred writes the standard SysML v2 encoding of a deferred signal: an ordered buffer item, a do action whose accept loop keeps each occurrence while the state is active, and an exit action that sends each kept occurrence to self. The SysML v1 migrator and the PSSM referee write it through this one package, so the two never spell the encoding apart.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoding

type Encoding struct {
	// Buffer and Flush name the do and exit actions; Split names the fork that
	// runs the accept loops beside each other and the state's own do behavior.
	Buffer, Split, Flush string
	// Including refers to SequenceFunctions::including from the state's scope;
	// Keeper to MigrationMetadata::DeferredKeeper, the annotation marking each
	// accept loop's accept as the one keeping the signal for the state.
	Including, Keeper string
	Signals           []Signal
}

Encoding is a state's deferred signals with the members encoding them.

func (*Encoding) Do

func (e *Encoding) Do(w Writer, own func() Own)

Do writes the do action that keeps each deferred signal while the state is active: one endless accept loop per route, run beside the state's own do behavior when own renders one. own is called inside the action's body, so its text is rendered at that indentation.

func (*Encoding) Exit

func (e *Encoding) Exit(w Writer, own func() Own)

Exit writes the exit action that sends each kept occurrence to the state's own object once the state exits, after the state's own exit behavior when own renders one, and empties each buffer so a later visit replays only what it kept. own is called inside the action's body.

func (*Encoding) Items

func (e *Encoding) Items(w Writer)

Items writes the ordered buffer item of each kept signal.

func (*Encoding) LoopCount

func (e *Encoding) LoopCount() int

LoopCount is how many accept loops the encoding writes in all.

type Loop

type Loop struct {
	Receive, Keep, Payload string
	Accept, Via            string
}

Loop is one accept loop of a kept signal: from the object itself when Via is "", via the port Via names otherwise. Its names are spelled as written; Accept names the signal as the accept's payload type, qualified past the payload's own name where that would shadow it.

type Own

type Own struct {
	// Text is the rendering, at the body's indentation; "" for no behavior.
	Text string
	// Written reports whether Text declares the nested action the encoding
	// then runs: a rendering of comments alone does not.
	Written bool
	// Run names the nested action; MadeUp is that name when the rendering
	// made it up for a behavior its source left anonymous, "" otherwise.
	Run, MadeUp string
}

Own is a state's own do or exit behavior rendered as the nested action the encoding runs beside its loops or ahead of its flush.

type Signal

type Signal struct {
	// Ref names the signal as the buffer's type; Kind is the usage keyword
	// the buffer is declared with, `item` when "", `attribute` for a signal
	// that is an attribute definition.
	Ref, Kind   string
	Buffer      string
	Item, Clear string
	Loops       []Loop
}

Signal is one signal a state keeps: the buffer item its occurrences fill, the accept loops that fill it, and the flush loop's members, every name spelled as written.

type Writer

type Writer interface {
	Line(s string)
	Block(header string, body func())
	Raw(text string)
	MadeUp(name string)
}

Writer is the sink an encoding is written into: a line at the current indentation, a brace-delimited block whose body is one level deeper, text already rendered at the current indentation, and a name the encoding made up for the block being written, which a sink with no use for it ignores.

Jump to

Keyboard shortcuts

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