Liking cljdoc? Tell your friends :D

eva.v2.system.protocols


DatabaseConnectioncljprotocol

update-latest-index-rootsclj

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

logclj

(log dbc)

reload-if-staleclj

(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-messageclj

(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-snapshotclj

(db-snapshot dbc)

process-txclj

(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-txclj

(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-txclj

(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-reloadclj

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

DatabaseConnectionStatecljprotocol

advance-db-from-log-entryclj

(advance-db-from-log-entry dbcs log-entry)

advance-to-tx-numclj

(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-logclj

(append-to-log dbcs log-entry timeout-ms)

commit-transaction-reportclj

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

reloadclj

(reload dbcs)

repair-logclj

(repair-log dbcs)

stale-snapshot?clj

(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-rootsclj

(update-index-roots dbcs index-roots)
source

ErrorListenerManagercljprotocol

register-error-listenerclj

(register-error-listener mn key f args)

unregister-error-listenerclj

(unregister-error-listener mn key)
source

Indexercljprotocol

advance-indexes!clj

(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!clj

(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?clj

(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-entryclj

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

PublisherManagercljprotocol

close-publisher!clj

(close-publisher! mn addr)

Closes the publisher for addr

Closes the publisher for addr

open-publisher!clj

(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!clj

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

RequestorManagercljprotocol

close-requestor!clj

(close-requestor! mn addr)

Closes the requestor registered for addr.

Closes the requestor registered for addr.

open-requestor!clj

(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!clj

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

ResponderManagercljprotocol

close-responder!clj

(close-responder! mn addr)

Closes the responder registered for addr.

Closes the responder registered for addr.

open-responder!clj

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

SubscriberManagercljprotocol

subscribe!clj

(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!clj

(unsubscribe! mn subscriber-id addr)

Closes the subscriber for address addr

Closes the subscriber for address addr
source

Transactorcljprotocol

process-index-updatesclj

(process-index-updates txor index-updates)

process-transactionclj

(process-transaction txor tx-data)
source

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

× close