The transaction processing in Fulcro is pluggable. This namespace is the implementation for the default transaction processing .
The transaction processing in Fulcro is pluggable. This namespace is the implementation for the default transaction processing .
(activate-submissions! {:keys [:com.fulcrologic.fulcro.application/runtime-atom]
:as app})
Activate all of the transactions that have been submitted since the last activation. After the items are activated a single processing step will run for the active queue.
Activate all of the transactions that have been submitted since the last activation. After the items are activated a single processing step will run for the active queue.
(active-remotes queue remotes)
Calculate which remotes still have network activity to do on the given active queue.
Calculate which remotes still have network activity to do on the given active queue.
(add-send! {:com.fulcrologic.fulcro.application/keys [runtime-atom] :as app}
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/id
:com.fulcrologic.fulcro.algorithms.tx-processing/options]
:as tx-node}
ele-idx
remote)
Generate a new send node and add it to the appropriate send queue. Returns the new send node.
Generate a new send node and add it to the appropriate send queue. Returns the new send node.
(advance-actions! app
{:com.fulcrologic.fulcro.algorithms.tx-processing/keys
[id elements]
:as node})
Runs any incomplete and non-blocked optimistic operations on a node.
Runs any incomplete and non-blocked optimistic operations on a node.
(app->remote-names app)
Returns a set of the names of the remotes from an app
Returns a set of the names of the remotes from an app
(app->remotes app)
Returns the remotes map from an app
Returns the remotes map from an app
(build-env app
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/options]
:as tx-node})
(build-env app
{:com.fulcrologic.fulcro.algorithms.tx-processing/keys [options]
:as tx-node}
addl)
(combine-sends app remote-name send-queue)
Takes a send queue and returns a map containing a new combined send node that can act as a single network request, along with the updated send queue.
Takes a send queue and returns a map containing a new combined send node that can act as a single network request, along with the updated send queue.
(dispatch-elements tx-node env dispatch-fn)
Run through the elements on the given tx-node and do the side-effect-free dispatch. This generates the dispatch map of things to do on that node.
Run through the elements on the given tx-node and do the side-effect-free dispatch. This generates the dispatch map of things to do on that node.
(dispatch-result!
app
tx-node
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/results
:com.fulcrologic.fulcro.algorithms.tx-processing/dispatch
:com.fulcrologic.fulcro.algorithms.tx-processing/original-ast-node]
:as tx-element}
remote)
Figure out the dispatch routine to trigger for the given network result. If it exists, send the result to it.
Returns the tx-element with the remote marked complete.
Figure out the dispatch routine to trigger for the given network result. If it exists, send the result to it. Returns the tx-element with the remote marked complete.
(distribute-element-results!
app
tx-node
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/results
:com.fulcrologic.fulcro.algorithms.tx-processing/complete?]
:as tx-element})
Distribute results and mark the remotes for those elements as complete.
Distribute results and mark the remotes for those elements as complete.
(distribute-results!
app
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/elements]
:as tx-node})
Walk all elements of the tx-node and call result dispatch handlers for any results that have not been distributed.
Walk all elements of the tx-node and call result dispatch handlers for any results that have not been distributed.
(element-with-work
remote-names
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/dispatch
:com.fulcrologic.fulcro.algorithms.tx-processing/started?]
:as element})
Returns a txnode element iff it has remaining (remote) work that has not been queued. Returns nil if there is no such element.
remote-names is the set of legal remote names.
Returns a txnode element iff it has remaining (remote) work that has not been queued. Returns nil if there is no such element. remote-names is the set of legal remote names.
(every-ast? ast-node-or-tree test)
Check if the given test
predicate is true for an AST node or for all the immediate children of an AST tree.
Check if the given `test` predicate is true for an AST node or for all the immediate children of an AST tree.
(extract-parallel sends)
Splits the given send queue into two send queues: [parallel-items sequential-items].
Splits the given send queue into two send queues: [parallel-items sequential-items].
(fully-complete? app
{:keys
[:com.fulcrologic.fulcro.algorithms.tx-processing/elements]
:as tx-node})
(idle-node? {:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/elements]
:as tx-node})
Returns true if the given node has no active network operations.
Returns true if the given node has no active network operations.
(mutation-ast? ast-node-or-tree)
Returns true if the given AST node or tree represents a mutation or sequence of mutations.
Returns true if the given AST node or tree represents a mutation or sequence of mutations.
(net-send! app send-node remote-name)
Process the send against the user-defined remote. Catches exceptions and calls error handler with status code 500 if the remote itself throws exceptions.
Process the send against the user-defined remote. Catches exceptions and calls error handler with status code 500 if the remote itself throws exceptions.
(process-queue!
{:com.fulcrologic.fulcro.application/keys [state-atom runtime-atom] :as app})
Run through the active queue and do a processing step.
Run through the active queue and do a processing step.
(process-send-queues! {:com.fulcrologic.fulcro.application/keys [runtime-atom]
:as app})
Process the send queues against the remotes. Updates the send queues on the app and returns the updated send queues.
Process the send queues against the remotes. Updates the send queues on the app and returns the updated send queues.
(process-tx-node! app
{:keys
[:com.fulcrologic.fulcro.algorithms.tx-processing/options]
:as tx-node})
(query-ast? ast-node-or-tree)
Returns true if the given AST node or tree represents a mutation or sequence of mutations.
Returns true if the given AST node or tree represents a mutation or sequence of mutations.
(queue-element-sends!
app
tx-node
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/idx
:com.fulcrologic.fulcro.algorithms.tx-processing/dispatch
:com.fulcrologic.fulcro.algorithms.tx-processing/started?]})
Queue all (unqueued) remote actions for the given element. Returns the (possibly updated) node.
Queue all (unqueued) remote actions for the given element. Returns the (possibly updated) node.
(queue-next-send! app
{:keys
[:com.fulcrologic.fulcro.algorithms.tx-processing/elements]
:as tx-node})
Assumes tx-node is to be processed pessimistically. Queues the next send if the node is currently idle on the network and there are any sends left to do. Adds to the send queue, and returns the updated tx-node.
Assumes tx-node is to be processed pessimistically. Queues the next send if the node is currently idle on the network and there are any sends left to do. Adds to the send queue, and returns the updated tx-node.
(queue-sends! app
{:keys [:com.fulcrologic.fulcro.algorithms.tx-processing/options
:com.fulcrologic.fulcro.algorithms.tx-processing/elements]
:as tx-node})
Finds any item(s) on the given node that are ready to be placed on the network queues and adds them. Non-optimistic multi-element nodes will only queue one remote operation at a time.
Finds any item(s) on the given node that are ready to be placed on the network queues and adds them. Non-optimistic multi-element nodes will only queue one remote operation at a time.
(record-result! app txn-id ele-idx remote result)
(record-result! {:com.fulcrologic.fulcro.application/keys [runtime-atom]
:as app}
txn-id
ele-idx
remote
result
result-key)
Record a network result on the given txn/element. If result-key is given it is used, otherwise defaults to ::results. Also removes the network send from the send queue so that remaining items can proceed, and schedules send processing.
Record a network result on the given txn/element. If result-key is given it is used, otherwise defaults to ::results. Also removes the network send from the send queue so that remaining items can proceed, and schedules send processing.
(remotes-active-on-node
{:com.fulcrologic.fulcro.algorithms.tx-processing/keys [elements] :as tx-node}
remotes)
Given a tx node and the set of legal remotes: returns a set of remotes that are active on that node.
Given a tx node and the set of legal remotes: returns a set of remotes that are active on that node.
(remove-send! {:com.fulcrologic.fulcro.application/keys [runtime-atom] :as app}
remote
txn-id
ele-idx)
Removes the send node (if present) from the send queue on the given remote.
Removes the send node (if present) from the send queue on the given remote.
(run-actions! app
{:com.fulcrologic.fulcro.algorithms.tx-processing/keys [id
elements]
:as node})
(schedule-activation! app)
(schedule-activation! app tm)
Schedule activation of submitted transactions. The default implementation copies all submitted transactions onto
the active queue and immediately does an active queue processing step. If tm
is not supplied (in ms) it defaults to 10ms.
Schedule activation of submitted transactions. The default implementation copies all submitted transactions onto the active queue and immediately does an active queue processing step. If `tm` is not supplied (in ms) it defaults to 10ms.
(schedule-queue-processing! app)
(schedule-queue-processing! app tm)
Schedule a processing of the active queue, which will advance the active transactions by a step.
If tm
is not supplied (in ms) it defaults to 10ms.
Schedule a processing of the active queue, which will advance the active transactions by a step. If `tm` is not supplied (in ms) it defaults to 10ms.
(schedule-sends! app)
(schedule-sends! app tm)
Schedule actual network activity. If tm
is not supplied (in ms) it defaults to 0ms.
Schedule actual network activity. If `tm` is not supplied (in ms) it defaults to 0ms.
(sort-queue-writes-before-reads send-queue)
Sort function on a send queue. Leaves any active nodes in front, and sorts the remainder of the queue so that writes appear before reads, without changing the relative order in blocks of reads/writes.
Sort function on a send queue. Leaves any active nodes in front, and sorts the remainder of the queue so that writes appear before reads, without changing the relative order in blocks of reads/writes.
(update-progress! app
{:keys
[:com.fulcrologic.fulcro.algorithms.tx-processing/elements]
:as tx-node})
Report all progress items to any registered progress dispatch and clear them from the tx-node. Returns the updated tx-node.
Report all progress items to any registered progress dispatch and clear them from the tx-node. Returns the updated tx-node.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close