Liking cljdoc? Tell your friends :D

wikla.ext

Even more nodes.

Even more nodes.
raw docstring

Contextclj/s


contextclj/s

(context pull push nodes)
(context properties pull push nodes)

Context pulls part of stash, runs children with it, then pushes it back.

Context runs children from left to right, Result decided in join:

  • Success only when all children reported Success
  • Failure immediately when child reported Failure
  • Running immediately when child reported Running

In all cases push gets called on the captured stash and Result. After Running tick is required again to re-capture stash and pull context from it.

Created as leaf, it captures stash during first tick. It then changes into composite, to part and join the children. Changes back to leaf on Running, to recapture and pull new sub-stash.

This constructor accepts properties map, sub-stash pull function, sub-stash reintroduction push callable and a sequence of at least one node.

Pull and push functions are expected to be:

(pull stash)        -> stash-part

(push stash Result) -> stash'

Note: If your push does different things based on Status flag, then remember to push on Success, Failure and Running. During Running other nodes might actually be given the stash to work over. Also on re-entry a pull call will happen.

Context pulls part of stash, runs children with it, then pushes it back.

Context runs children from left to right, Result decided in join:

* Success only when all children reported Success
* Failure immediately when child reported Failure
* Running immediately when child reported Running

In all cases push gets called on the captured stash and Result. After
Running tick is required again to re-capture stash and pull context from it.

Created as leaf, it captures stash during first tick. It then changes into
composite, to part and join the children. Changes back to leaf on Running,
to recapture and pull new sub-stash.

This constructor accepts properties map, sub-stash pull function, sub-stash
reintroduction push callable and a sequence of at least one node.

Pull and push functions are expected to be:

    (pull stash)        -> stash-part

    (push stash Result) -> stash'

Note: If your push does different things based on Status flag, then remember
to push on Success, Failure and Running. During Running other nodes might
actually be given the stash to work over. Also on re-entry a pull call
will happen.
raw docstring

context?clj/s

(context? node)

Is given node a conforming Context node?

Is given node a conforming Context node?
raw docstring

push-keyclj/s

(push-key literal-key)

Given literal-key returns push function associating on that key.

Given literal-key returns push function associating on that key.
raw docstring

Robinclj/s


robinclj/s

(robin summary-fn nodes)
(robin properties summary-fn nodes)

Robin runs children in a round-robin fashion, until all are done. It then ticks summary-action with final stash.

  • Success when summary-action reported Success
  • Failure when summary-action reported Failure
  • Running when summary-action reported Running (Robin is soft reset)

Child that returned Running is not re-executed immediately -- next child is selected for execution, if available. Robin never returns Running from children, it puts them back in the queue for execution.

Final Result is created by summary-action executed over the final stash. If summary-action returns Running -- Robin is reset and returns Running. Otherwise Success or Failure is reported back up.

Accepts properties shared between Robin and summary-action, a summary-fn callable used to seed the summary-action and a sequence of at least one node.

Expectations:

(tick (action properties summary-fn) stash) →  Result

Specifically:

(tick (action properties summary-fn) stash)
  →  Success | Failure | Running
Robin runs children in a round-robin fashion, until all are done. It then
ticks summary-action with final stash.

* Success when summary-action reported Success
* Failure when summary-action reported Failure
* Running when summary-action reported Running (Robin is soft reset)

Child that returned Running is not re-executed immediately -- next child
is selected for execution, if available. Robin never returns Running from
children, it puts them back in the queue for execution.

Final Result is created by summary-action executed over the final stash.
If summary-action returns Running -- Robin is reset and returns Running.
Otherwise Success or Failure is reported back up.

Accepts properties shared between Robin and summary-action, a summary-fn
callable used to seed the summary-action and a sequence of at least one node.

Expectations:

    (tick (action properties summary-fn) stash) →  Result

Specifically:

    (tick (action properties summary-fn) stash)
      →  Success | Failure | Running
raw docstring

robin?clj/s

(robin? node)

Is given node a conforming Robin node?

Is given node a conforming Robin node?
raw docstring

transactionclj/s

(transaction nodes)
(transaction properties nodes)

Transaction runs children from left to right, Result decided in join:

  • Success only when all children reported Success
  • Failure immediately when child reported Failure
  • Running immediately when child reported Running

On Failure returns stash from before Transaction execution. Works best when stash is IMMUTABLE. With mutable all bets are off.

Created as leaf, it captures stash during first tick. It then changes into composite, to part and join the children.

This constructor accepts properties map and a sequence of at least one node.

Transaction runs children from left to right, Result decided in join:

* Success only when all children reported Success
* Failure immediately when child reported Failure
* Running immediately when child reported Running

On Failure returns stash from before Transaction execution. Works best when
stash is IMMUTABLE. With mutable all bets are off.

Created as leaf, it captures stash during first tick. It then changes into
composite, to part and join the children.

This constructor accepts properties map and a sequence of at least one node.
raw docstring

Transactionclj/s


transaction?clj/s

(transaction? node)

Is given node a conforming Transaction node?

Is given node a conforming Transaction node?
raw docstring

Unlessclj/s


unlessclj/s

(unless s-condition node)
(unless properties s-condition node)

Get child executed and if it's done - pass the stash through s-condition.

  • If child returned RUNNING, report RUNNING.
  • If child is SUCCESS or FAILURE:
    • if (s-condition stash) returns true report what child returned.
    • otherwise return FAILURE.
Get child executed and if it's done - pass the stash through `s-condition`.

* If child returned RUNNING, report RUNNING.
* If child is SUCCESS or FAILURE:
    - if `(s-condition stash)` returns true report what child returned.
    - otherwise return FAILURE.
raw docstring

unless?clj/s

(unless? node)

Is given node a conforming Unless node?

Is given node a conforming Unless node?
raw docstring

untilclj/s

(until s-condition node)
(until properties s-condition node)

Get child executed and if it's done - pass the stash through s-condition.

  • If child returned RUNNING, report RUNNING.
  • If child is SUCCESS or FAILURE:
    • if (s-condition stash) returns true report SUCCESS
    • otherwise soft reset the child and return RUNNING.
Get child executed and if it's done - pass the stash through `s-condition`.

* If child returned RUNNING, report RUNNING.
* If child is SUCCESS or FAILURE:
    - if `(s-condition stash)` returns true report SUCCESS
    - otherwise soft reset the child and return RUNNING.
raw docstring

Untilclj/s


until?clj/s

(until? node)

Is given node a conforming Until node?

Is given node a conforming Until node?
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close