(update-latest-index-roots dbc index-updates)
Called by a message handler receives an index-update message. Mutates the database-connection by merging in the latest index-root updates.
Called by a message handler receives an index-update message. Mutates the database-connection by merging in the latest index-root updates.
(log dbc)
(reload-if-stale dbc)
Will check if the database connection's state has become stale. If it has, it will reload from storage.
Will check if the database connection's state has become stale. If it has, it will reload from storage.
(handle-transaction-message dbc tx-msg)
Handles a transaction message, updating local state and producing a transaction report containing :db-before :db-after :tempids and :tx-data
Handles a transaction message, updating local state and producing a transaction report containing :db-before :db-after :tempids and :tx-data
(db-snapshot dbc)
(process-tx dbc tx-data)
Validates a transaction. Returns tx-report containing: :log-entry, :db-before, :db-after, :tempids, :tx-data
Validates a transaction. Returns tx-report containing: :log-entry, :db-before, :db-after, :tempids, :tx-data
(commit-tx dbc tx-data)
Process a transaction, appending it to the tx-log if successful. Returns a tx-report
Process a transaction, appending it to the tx-log if successful. Returns a tx-report
(advance-to-tx dbc tx-num)
Advances the database connection to tx-num if it is not yet at at least tx-num. Assumes the persisted transaction log has been updated to >= tx-num. Returns the most recent database state, which will be at >= tx-num.
Advances the database connection to tx-num if it is not yet at at least tx-num. Assumes the persisted transaction log has been updated to >= tx-num. Returns the most recent database state, which will be at >= tx-num.
(repair-and-reload dbc)
Attempts to reload the database connection state from the backing store. Will repair the head of the transaction log if it is out of sync with the most recently persisted log entry. Mutates state, returns original connection.
Attempts to reload the database connection state from the backing store. Will repair the head of the transaction log if it is out of sync with the most recently persisted log entry. Mutates state, returns original connection.
(advance-db-from-log-entry dbcs log-entry)
(advance-to-tx-num dbcs tx-num)
Advances the database connection to tx-num if it is not yet at at least tx-num. Assumes the persisted transaction log has been updated to >= tx-num. Returns the most recent database state, which will be at >= tx-num.
Advances the database connection to tx-num if it is not yet at at least tx-num. Assumes the persisted transaction log has been updated to >= tx-num. Returns the most recent database state, which will be at >= tx-num.
(append-to-log dbcs log-entry timeout-ms)
(commit-transaction-report dbcs tx-report)
(commit-transaction-report dbcs tx-report timeout-ms)
Takes a transaction report containing :log-entry, :db-before, :db-after, :tempids, and :tx-data. Will write the log entry to the transaction log and return a new DatabaseConnectionState object with the updated transaction log, database snapshot, and index roots.
Takes a transaction report containing :log-entry, :db-before, :db-after, :tempids, and :tx-data. Will write the log entry to the transaction log and return a new DatabaseConnectionState object with the updated transaction log, database snapshot, and index roots.
(reload dbcs)
(repair-log dbcs)
(stale-snapshot? dbcs db-snapshot)
Is the given snapshot stale wrt a fresh read of the transaction log state?
Is the given snapshot stale wrt a fresh read of the transaction log state?
(update-index-roots dbcs index-roots)
(register-error-listener mn key f args)
(unregister-error-listener mn key)
(advance-indexes! is tx-log-entry)
Update the indexer state to at least the provided tx-log-entry
Update the indexer state to at least the provided tx-log-entry
(maybe-flush! is)
If the staged indexes met the minimum criteria for flushing, flushes the staged index updates to persistent storage.
If the staged indexes met the minimum criteria for flushing, flushes the staged index updates to persistent storage.
(pending-updates? is tx-log-entry)
If there are updated indexes that are not in the log entry, return them, else nil
If there are updated indexes that are not in the log entry, return them, else nil
(process-entry is tx-log-entry)
Advance the indexer state to include the tx-log-entry. If the indexes are flushed as a result, or if the indexer has pending updates, will return a map of updated index roots.
Advance the indexer state to include the tx-log-entry. If the indexes are flushed as a result, or if the indexer has pending updates, will return a map of updated index roots.
(close-publisher! mn addr)
Closes the publisher for addr
Closes the publisher for addr
(open-publisher! mn addr opts)
Starts a publisher to addr with opts. Returns the publisher.
Starts a publisher to addr with opts. Returns the publisher.
(publish! mn addr publish-msg)
Submits publish-msg to all subscribers consuming from addr. Async by default.
Submits publish-msg to all subscribers consuming from addr. Async by default.
(close-requestor! mn addr)
Closes the requestor registered for addr.
Closes the requestor registered for addr.
(open-requestor! mn addr opts)
Starts a requestor for addr with opts. Returns the requestor.
Starts a requestor for addr with opts. Returns the requestor.
(request! mn addr request-msg)
Submits request-msg to a responder consuming from addr.
Returns a future that should eventually contain the response to the request.
Submits request-msg to a responder consuming from addr. Returns a future that should eventually contain the response to the request.
(close-responder! mn addr)
Closes the responder registered for addr.
Closes the responder registered for addr.
(open-responder! mn addr f opts)
Starts a responder for addr using the function f with opts.
Params: addr - string representing the queue to respond to. f - a function that takes a single argument, the request object, and returns a response. opts - a map of options
If the function f throws, the exception will be caught, logged, and returned to the requestor.
Starts a responder for addr using the function f with opts. Params: addr - string representing the queue to respond to. f - a function that takes a single argument, the request object, and returns a response. opts - a map of options If the function f throws, the exception will be caught, logged, and returned to the requestor.
(subscribe! mn subscriber-id addr f opts)
Starts a subscriber for addr using the function f with opts.
Params: addr - string representing the queue to subscribe to. f - a function that takes a single argument, the published object. otps - a map of options
If the function f throws, the exception will be caught and logged.
Starts a subscriber for addr using the function f with opts. Params: addr - string representing the queue to subscribe to. f - a function that takes a single argument, the published object. otps - a map of options If the function f throws, the exception will be caught and logged.
(unsubscribe! mn subscriber-id addr)
Closes the subscriber for address addr
Closes the subscriber for address addr
(process-index-updates txor index-updates)
(process-transaction txor tx-data)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close