Liking cljdoc? Tell your friends :D
All platforms.

com.fulcrologic.statecharts.event-queue.core-async-event-loop

A queue that uses core.async to enable support for delayed events and also provides a run-event-loop! mechanism for automatically processing events as they arrive (optional). You may, of course, send the queue the evts/cancel-event to exit your machine (without reaching the final state) to cause the run-event-loop! to exit.

This queue can support any number of running statecharts via their session-ids. send! will reject any request that is missing a target that defines the target session-id. Just use the same instance as the event queue for every chart.

A queue that uses core.async to enable support for delayed events and also provides a `run-event-loop!` mechanism
for automatically processing events as they arrive (optional). You may, of course, send the queue the
`evts/cancel-event` to exit your machine (without reaching the final state) to cause the `run-event-loop!` to
exit.

This queue can support any number of running statecharts via their session-ids. `send!` will reject any request that
is missing a target that defines the target session-id. Just use the same instance as the event queue for every
chart.
raw docstring

run-event-loop!clj/s

(run-event-loop! {:com.fulcrologic.statecharts/keys
                    [processor working-memory-store event-queue]
                  :as env}
                 resolution-ms)

Initializes a new session using sp/start! on the processor and assigns it session-id. Then runs a continuous loop polling the event-queue for new events and processing them.

wmem-atom is an atom that will be updated with the latest working memory of the state machine, and allows you to look at the state of it from outside. It is safe to read the active states from ::sc/configuration of the working memory, but you should leverage the data-model protocol for interfacing with the data a machine might need to see or manipulate.

Runs a core.async loop that will run receive-events! at the given time resolution.

Returns an atom containing a boolean that is what keeps the event loop running. If you swap that atom to false then the event loop will exit.

Initializes a new session using `sp/start!` on the processor and assigns it `session-id`.
Then runs a continuous loop polling the event-queue for new events and processing them.

`wmem-atom` is an atom that will be updated with the latest working memory of the state
machine, and allows you to look at the state of it from outside.  It is safe to read the active states
from ::sc/configuration of the working memory, but you should leverage the data-model protocol for
interfacing with the data a machine might need to see or manipulate.

Runs a core.async loop that will run `receive-events!` at the given time resolution.

Returns an atom containing a boolean that is what keeps the event loop running. If you swap that atom to `false` then
the event loop will exit.
sourceraw docstring

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

× close