Liking cljdoc? Tell your friends :D

lambdaconnect-sync.hooks


concat-hooks-push-transactionsclj

(concat-hooks-push-transactions hooks-transaction push-transaction)
source

get-colliding-ids-attrsclj

(get-colliding-ids-attrs transaction1 transaction2)
source

get-datomic-relationshipsclj

(get-datomic-relationships config snapshot)
source

get-id-to-correct-idclj

(get-id-to-correct-id config snapshot-before snapshot ids)
source

get-ids-from-entryclj

(get-ids-from-entry datomic-relationships entry)
source

send-specific-hooks!clj

(send-specific-hooks! config
                      before-snapshot
                      snapshot
                      interesting-objects
                      entities-by-name
                      user
                      hook-fun)
(send-specific-hooks! config
                      before-snapshot
                      snapshot
                      interesting-objects
                      entities-by-name
                      user
                      hook-fun
                      common-state)
(send-specific-hooks! config
                      before-snapshot
                      snapshot
                      interesting-objects
                      entities-by-name
                      user
                      hook-fun
                      common-state
                      previous-results
                      finaliser-fun)

This function takes a map of {"entity-name" {uuid1 obj1 uuid2 obj2 uuid3 obj3]}

It uses the snapshot to re-fetch all the objects using just their uuids (the obj1 obj2 obj3 etc. are ignored). Snapshot would most likely be a speculated db (after applying push transaction).

It then calls the hook-fun for each object, expecting it to return transaction pairs (message-queue and main db). This way the creation/update of push objects can have some db-related side effects.

The hook functions are instructed of the current state of the speculated db (snapshot), state of the db before speculation (before-snapshot), object to consider, user that has triggered the push and finally some shared state that can be used to track advanced changes between calls (necessarily an atom!).

Finally, if the finaliser function is provided, it is called with final transactions and shared state and provides its own transaction/mq-transaction pair state.

At the very end, a transaction or a map {:transaction mq-transaction} is being returned.

This function takes a map of {"entity-name" {uuid1 obj1 uuid2 obj2 uuid3 obj3]} 

It uses the snapshot to re-fetch all the objects using just their uuids (the obj1 obj2 obj3 etc. are ignored).
Snapshot would most likely be a speculated db (after applying push transaction).  

It then calls the hook-fun for each object, expecting it to return transaction pairs (message-queue and main db).
This way the creation/update of push objects can have some db-related side effects.

The hook functions are instructed of the current state of the speculated db (snapshot), state of the db before speculation (before-snapshot),
object to consider, user that has triggered the push and finally some shared state that can be used to track advanced changes between calls (necessarily an atom!).

Finally, if the finaliser function is provided, it is called with final transactions and shared state and provides its own transaction/mq-transaction pair state.

At the very end, a transaction or a map {:transaction mq-transaction} is being returned.
sourceraw docstring

update-colliding-entryclj

(update-colliding-entry colliding-ids-attrs entry)
source

update-ids-in-entryclj

(update-ids-in-entry datomic-relationships id-to-correct-id entry)
source

update-ids-in-transactionclj

(update-ids-in-transaction config
                           datomic-relationships
                           transaction
                           snapshot-before
                           snapshot)
source

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

× close