Liking cljdoc? Tell your friends :D

com.fulcrologic.fulcro.algorithms.tx-processing

The transaction processing in Fulcro is (intended to be) pluggable. This namespace is the implementation for the default transaction processing . At the present time there is no documentation on how such an override would be written, nor is it necessarily recommended since many of the desirable and built-in behaviors of Fulcro are codified here.

The transaction processing in Fulcro is (intended to be) pluggable. This namespace is the
implementation for the default transaction processing . At the present time there is no documentation on how
such an override would be written, nor is it necessarily recommended since many of the desirable and built-in
behaviors of Fulcro are codified here. 
raw docstring

activate-submissions!clj/s

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

active-remotesclj/s

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

add-send!clj/s

(add-send! {:com.fulcrologic.fulcro.application/keys [runtime-atom] :as app}
           {:com.fulcrologic.fulcro.algorithms.tx-processing/keys [id 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.
sourceraw docstring

advance-actions!clj/s

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

app->remote-namesclj/s

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

app->remotesclj/s

(app->remotes app)

Returns the remotes map from an app

Returns the remotes map from an app
sourceraw docstring

build-envclj/s

(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)
source

combine-sendsclj/s

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

compute-desired-ast-nodeclj/s

(compute-desired-ast-node app remote tx-node tx-element)

Add the ::desired-ast-nodes and ::transmitted-ast-nodes for remote to the tx-element based on the dispatch for the remote of the original mutation.

Add the ::desired-ast-nodes and ::transmitted-ast-nodes for `remote` to the tx-element based on the dispatch for the `remote` of the original mutation.
sourceraw docstring

dispatch-elementsclj/s

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

dispatch-result!clj/s

(dispatch-result! app
                  tx-node
                  {:com.fulcrologic.fulcro.algorithms.tx-processing/keys
                     [results dispatch desired-ast-nodes transmitted-ast-nodes
                      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.
sourceraw docstring

distribute-element-results!clj/s

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

distribute-results!clj/s

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

element-with-workclj/s

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

every-ast?clj/s

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

extract-parallelclj/s

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

fully-complete?clj/s

(fully-complete? app
                 {:keys
                    [:com.fulcrologic.fulcro.algorithms.tx-processing/elements]
                  :as tx-node})
source

idle-node?clj/s

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

mutation-ast?clj/s

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

net-send!clj/s

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

process-queue!clj/s

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

process-send-queues!clj/s

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

process-tx-node!clj/s

(process-tx-node! app
                  {:keys
                     [:com.fulcrologic.fulcro.algorithms.tx-processing/options]
                   :as tx-node})
source

query-ast?clj/s

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

queue-element-sends!clj/s

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

queue-next-send!clj/s

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

queue-sends!clj/s

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

record-result!clj/s

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

remotes-active-on-nodeclj/s

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

remove-send!clj/s

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

requested-refreshesclj/s

(requested-refreshes app queue)
source

run-actions!clj/s

(run-actions! app
              {:com.fulcrologic.fulcro.algorithms.tx-processing/keys [id
                                                                      elements]
               :as node})
source

schedule-activation!clj/s

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

schedule-queue-processing!clj/s

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

schedule-sends!clj/s

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

sort-queue-writes-before-readsclj/s

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

top-keysclj/s

(top-keys {:keys [type key children] :as ast})
source

tx-nodeclj/s

(tx-node tx)
(tx-node tx options)
source

update-progress!clj/s

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

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

× close