(concat-hooks-push-transactions hooks-transaction push-transaction)
(get-datomic-relationships-from-model entities-by-name)
(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.
(update-ids-in-transaction config
datomic-relationships
transaction
snapshot-before
snapshot)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close