An abstract program runtime for ASTs produced by ablauf.job.ast
.
This exposes two functions for the outside world: make
and restart
You are expected to create a program to be ran with the functions
available in the ablauf.job.ast
namespace. This program is then
initialized with the rough equivalent of an instruction pointer and
a context.
This namespace makes no guess as to how program instructions are actually performed, instead, for each position of the program, it yields the instructions to carry out. There might be more than one if parallelism is used.
The logical flow is thus:
For an actual full fledged program runner, a runner using
manifold as the underlying dispatching engine is provided
in ablauf.job.manifold
.
An abstract program runtime for ASTs produced by `ablauf.job.ast`. This exposes two functions for the outside world: `make` and `restart` You are expected to create a *program* to be ran with the functions available in the `ablauf.job.ast` namespace. This program is then initialized with the rough equivalent of an instruction pointer and a context. This namespace makes no guess as to how program instructions are actually performed, instead, for each position of the program, it yields the instructions to carry out. There might be more than one if parallelism is used. The logical flow is thus: - call restart on a program with an empty result list - carry out resulting actions - call restart on the result of the actions For an actual full fledged program runner, a runner using **manifold** as the underlying dispatching engine is provided in `ablauf.job.manifold`.
(ast-zip ast)
Given a well-formed AST (as per ablauf.job.ast
), yield a zipper
Given a well-formed AST (as per `ablauf.job.ast`), yield a zipper
(augment context {:ast/keys [augment] :exec/keys [result output] :as node})
When an AST node contains an augment
key, process it to
augment the resulting context. Augments have a source:
a function of the output, a keyword or vector, of keyword
pointing to a path in the output. Augments also have a destination
a key or key vector of the position in which to augment the context.
When an AST node contains an `augment` key, process it to augment the resulting context. Augments have a source: a function of the output, a keyword or vector, of keyword pointing to a path in the output. Augments also have a destination a key or key vector of the position in which to augment the context.
(augmentable? {:ast/keys [augment] :as node})
Predicate to test for an augmentable node
Predicate to test for an augmentable node
(done? job)
Predicate to test for completion of a (sub)job
Predicate to test for completion of a (sub)job
(failed? job)
Predicate to test for failure of a (sub)job
Predicate to test for failure of a (sub)job
(index-ast pos)
Uniquely identifies job nodes, for later merging
Uniquely identifies job nodes, for later merging
Creates a job, suitable for restart
from a valid AST as
produced by functions in ablauf.job.ast
Creates a job, suitable for `restart` from a valid AST as produced by functions in `ablauf.job.ast`
(make-with-context ast context)
Creates a job, attaching an initial context map, as for make
,
this creates a tuple suitable for restart
Creates a job, attaching an initial context map, as for `make`, this creates a tuple suitable for `restart`
(merge-results job context nodes)
Updates a job given a list of node updates. Node updates either come from an action dispatch return, or from newly found dispatchs
Updates a job given a list of node updates. Node updates either come from an action dispatch return, or from newly found dispatchs
(pending? job)
Predicate to test for pending completion of a (sub)job
Predicate to test for pending completion of a (sub)job
(restart [job context] results)
Given a job, and node updates for it, figure out the next course of action to take.
Yields an updated job and potential side-effects. The result has the following structure:
[job dispatchs]
This allows using the return of restart
as an accumulator
for reductions
or similar functions.
Given a job, and node updates for it, figure out the next course of action to take. Yields an updated job and potential side-effects. The result has the following structure: [job dispatchs] This allows using the return of `restart` as an accumulator for `reductions` or similar functions.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close