|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
One resolved statement. More...
#include <cpp/a11/flow/graph.h>
Public Attributes | |
| StepKind | kind = StepKind::kPipe |
| std::string | label |
The name this step is known by: a bound name, or action/for/if with a #2 after it where one label is used twice. | |
| BodyId | body = kNone |
| std::vector< StepId > | after |
| What it waits for. | |
| syntax::Location | location |
| std::string | action |
kCall. | |
| std::string | mode |
| std::string | node_map |
| std::optional< absl::Duration > | timeout |
| bool | tee = false |
| bool | tolerant = false |
| std::vector< std::pair< std::string, ExprId > > | headers |
| std::vector< std::string > | forward |
| ExprId | action_id = kNone |
| absl::flat_hash_map< std::string, RefId > | ports |
Every port of this call that the flow wired up, by direction:name. | |
| RefId | status = kNone |
| Its outcome, once something has asked for one. | |
| RefId | source = kNone |
kPipe reads and writes these refs. kCapture reads source. | |
| RefId | destination = kNone |
| bool | discard = false |
kPipe: -> _, which reads the stream and keeps nothing. | |
| std::optional< long long > | count |
kSkip: skip n port, which claims no reader slot – the count is applied where the stream is produced and this step has nothing left to do. | |
| std::string | slot |
kCapture: which slot of the enclosing loop it fills. | |
| RefId | outcome = kNone |
kWait/kDrain: the outcome read, and whether a bad one is this flow's business or the subject's. | |
| std::vector< RefId > | subjects |
kWait: the outcomes of a wait first of / wait all of, in the order they were written. | |
| bool | race = false |
kWait: whether the first subject to finish is enough. | |
| RefId | winner = kNone |
kWait: the value a race is – which subject won – for whoever reads it. | |
| StepId | target = kNone |
kCancel: the call to stop. | |
| ExprId | code = kNone |
kFail. | |
| ExprId | message = kNone |
| std::string | code_name |
The canonical code fail named outright: fail not_found "...". | |
| LogTail | log |
kLog: the level, the format and what fills it. | |
| std::vector< BodyId > | bodies |
kForEach, kRepeat, kIf: the bodies nested here, in reading order. | |
| RefId | item = kNone |
kForEach: the value and the index each pass binds. | |
| RefId | index = kNone |
| int | parallel = 1 |
| RefId | carry = kNone |
kRepeat: what it carries, where the next pass's value comes from, and when it stops. | |
| RefId | carry_source = kNone |
| syntax::Constant | start |
| std::optional< int > | max_iterations |
max n, where one was written; nothing means the loop is bounded only by its condition. | |
| ExprId | condition = kNone |
| bool | stop_when = true |
One resolved statement.
| std::string a11::flow::graph::Step::action |
kCall.
| std::vector<StepId> a11::flow::graph::Step::after |
What it waits for.
| std::vector<BodyId> a11::flow::graph::Step::bodies |
kForEach, kRepeat, kIf: the bodies nested here, in reading order.
An if has two; the loops have one.
kRepeat: what it carries, where the next pass's value comes from, and when it stops.
| std::string a11::flow::graph::Step::code_name |
The canonical code fail named outright: fail not_found "...".
Kept apart from code because a written-out name is not an expression – nothing in scope is called not_found – and the runtime should not have to decide which of the two a bare word was. Where this is set, code is not.
| std::optional<long long> a11::flow::graph::Step::count |
kSkip: skip n port, which claims no reader slot – the count is applied where the stream is produced and this step has nothing left to do.
| bool a11::flow::graph::Step::discard = false |
kPipe: -> _, which reads the stream and keeps nothing.
The opposite end of the language from a counted skip: that one is elided, because the values were already taken where the stream is produced and the step has nothing left to do. A discard is performed – every stage on the pipeline runs, and the values are dropped only once there is nowhere left for them to go. So this is a step with a reader slot (see [FlowGraph::Sources]) and no destination at all: destination is kNone, nothing counts as a writer of anything, and no data is kept.
| std::vector<std::string> a11::flow::graph::Step::forward |
| std::vector<std::pair<std::string, ExprId> > a11::flow::graph::Step::headers |
| StepKind a11::flow::graph::Step::kind = StepKind::kPipe |
| std::string a11::flow::graph::Step::label |
The name this step is known by: a bound name, or action/for/if with a #2 after it where one label is used twice.
| syntax::Location a11::flow::graph::Step::location |
| LogTail a11::flow::graph::Step::log |
kLog: the level, the format and what fills it.
| std::optional<int> a11::flow::graph::Step::max_iterations |
max n, where one was written; nothing means the loop is bounded only by its condition.
| std::string a11::flow::graph::Step::mode |
| std::string a11::flow::graph::Step::node_map |
kWait/kDrain: the outcome read, and whether a bad one is this flow's business or the subject's.
| int a11::flow::graph::Step::parallel = 1 |
| absl::flat_hash_map<std::string, RefId> a11::flow::graph::Step::ports |
Every port of this call that the flow wired up, by direction:name.
| bool a11::flow::graph::Step::race = false |
kWait: whether the first subject to finish is enough.
| std::string a11::flow::graph::Step::slot |
kCapture: which slot of the enclosing loop it fills.
kPipe reads and writes these refs. kCapture reads source.
| syntax::Constant a11::flow::graph::Step::start |
| bool a11::flow::graph::Step::stop_when = true |
| std::vector<RefId> a11::flow::graph::Step::subjects |
kWait: the outcomes of a wait first of / wait all of, in the order they were written.
Empty for the single-subject form, whose one outcome is outcome – which is also the first of these, so anything reading a wait's outcome keeps working without knowing which form it was.
| bool a11::flow::graph::Step::tee = false |
| std::optional<absl::Duration> a11::flow::graph::Step::timeout |
| bool a11::flow::graph::Step::tolerant = false |
kWait: the value a race is – which subject won – for whoever reads it.
kNone where nothing does, and on the forms that have no winner.