Liking cljdoc? Tell your friends :D

ablauf.job

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, an SQL backed one in ablauf.job.sql.

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`, an SQL backed one in `ablauf.job.sql`.
raw docstring

abortclj

(abort job)
(abort job reason)

Given a job, mark pending all pending leafs as failure with the proper reason. Yields an updated job.

Given a job, mark pending all pending leafs as failure with the proper reason.
Yields an updated job.
sourceraw docstring

ast-zipclj

(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
sourceraw docstring

augmentclj

(augment context {:ast/keys [augment] :exec/keys [result output]})

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.
sourceraw docstring

augmentable?clj

(augmentable? {:ast/keys [augment] :as node})

Predicate to test for an augmentable node

Predicate to test for an augmentable node
sourceraw docstring

done?clj

(done? job)

Predicate to test for completion of a (sub)job Here is the per-status breakdown:

statusdone?
:job/failureY
:job/successY
:job/pendingN
Predicate to test for completion of a (sub)job
Here is the per-status breakdown:

| status | `done?` |
|--------|---------|
| `:job/failure` | Y |
| `:job/success` | Y |
| `:job/pending` | N |
sourceraw docstring

eligible?clj

(eligible? job)

Predicate to test for pending completion of a (sub)job. Here is the per-status breakdown:

statuseligible?
:job/failureN
:job/successN
:job/pendingY
Predicate to test for pending completion of a (sub)job.
Here is the per-status breakdown:

| status | `eligible?` |
|--------|---------|
| `:job/failure` | N |
| `:job/success` | N |
| `:job/pending` | Y |
sourceraw docstring

failed?clj

(failed? job)

Predicate to test for failure of a (sub)job Here is the per-status breakdown:

statusfailed?
:job/failureY
:job/successN
:job/pendingN
Predicate to test for failure of a (sub)job
Here is the per-status breakdown:

| status | `failed?` |
|--------|---------|
| `:job/failure` | Y |
| `:job/success` | N |
| `:job/pending` | N |
sourceraw docstring

index-astclj

(index-ast pos)

Uniquely identifies job nodes, for later merging

Uniquely identifies job nodes, for later merging
sourceraw docstring

makeclj

(make ast)

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`
sourceraw docstring

make-with-contextclj

(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`
sourceraw docstring

merge-dispatchsclj

(merge-dispatchs job nodes)
source

merge-resultsclj

(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.
sourceraw docstring

pending?clj

(pending? job)

Predicate to test for pending completion of a (sub)job Here is the per-status breakdown:

statuspending?
:job/failureN
:job/successN
:job/pendingY
Predicate to test for pending completion of a (sub)job
Here is the per-status breakdown:

| status | `pending?` |
|--------|---------|
| `:job/failure` | N |
| `:job/success` | N |
| `:job/pending` | Y |
sourceraw docstring

prepare-replayclj

(prepare-replay job)

It will traverse the whole job and:

  1. mark as unstarted all pending idempotent leafs
  2. mark as failure all pending non idempotent leafs

Yields the modified job

It will traverse the whole job and:
1. mark as unstarted all pending idempotent leafs
2. mark as failure all pending non idempotent leafs

Yields the modified job
sourceraw docstring

pruneclj

(prune ast)

Remove empties :ast/nodes leaves

Remove empties :ast/nodes leaves
sourceraw docstring

reloadclj

(reload ast context)

Yield a job ready for restart from a data ast and an optional context.

Yield a job ready for restart from a data ast and an optional context.
sourceraw docstring

restartclj

(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 context 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 context dispatchs]

This allows using the return of `restart` as an accumulator
for `reductions` or similar functions.
sourceraw docstring

statusclj

(status ast)

Get the job status from an ast.

Status predicates breakdown: | status | done? | failed? | eligible? | pending? | |--------|---------|-----------|-------------|------------| | :job/failure | Y | Y | N | N | | :job/success | Y | N | N | N | | :job/pending | N | N | Y | Y |

Get the job status from an ast.

Status predicates breakdown:
| status | `done?` | `failed?` | `eligible?` | `pending?` |
|--------|---------|-----------|-------------|------------|
| `:job/failure` | Y | Y | N | N |
| `:job/success` | Y | N | N | N |
| `:job/pending` | N | N | Y | Y |
sourceraw docstring

unzipclj

(unzip zipper)

Get back to a data AST from a program's zipper

Get back to a data AST from a program's zipper
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close