Liking cljdoc? Tell your friends :D

fluree.db.session


acquire-indexing-lock!clj/s

(acquire-indexing-lock! session block)

Attempts to acquire indexing lock, and if successful returns true, else false.

Attempts to acquire indexing lock, and if successful returns true, else false.
raw docstring

alias->id-cacheclj/s


blank-dbclj/s

(blank-db conn ledger)

Creates a session and returns a blank db.

Creates a session and returns a blank db.
raw docstring

block-response->tx-responseclj/s

(block-response->tx-response block-result txid)

Blocks can have multiple transactions. If we are monitoring a single transaction we take a full block response and return a map with just that transaction's details. If the entire block details are desired, the block can be used to retrieve them.

If throw? is true, throws an exception if non-2xx response.

Blocks can have multiple transactions. If we are monitoring a single transaction
we take a full block response and return a map with just that transaction's details.
If the entire block details are desired, the block can be used to retrieve them.

If throw? is true, throws an exception if non-2xx response.
raw docstring

cas-db!clj/s

(cas-db! session old-db-ch new-db-ch)

Performs a compare and set! to update db, but only does so if existing db promise-chan is the same as old-db-ch.

Returns true if successful, false if it did not replace.

Performs a compare and set! to update db, but only does so if
existing db promise-chan is the same as old-db-ch.

Returns true if successful, false if it did not replace.
raw docstring

clear-db!clj/s

(clear-db! session)

Clears db from cache, forcing a new full load next time db is requested.

Clears db from cache, forcing a new full load next time db is requested.
raw docstring

closeclj/s

(close session)
(close network dbid)

Properly shuts down a session. Returns true if shut down, false if it was already shut down.

Calling with a session will shut down session, calling with two arity network + dbid will see if a session is in cache and then perform the shutdown on the cached session, else will return false.

Properly shuts down a session.
Returns true if shut down, false if it was already shut down.

Calling with a session will shut down session, calling with
two arity network + dbid will see if a session is in cache and
then perform the shutdown on the cached session, else will return
false.
raw docstring

close-all-sessionsclj/s

(close-all-sessions)
(close-all-sessions conn-id)

Useful for a shutdown process. Closes all sessions for a given connection-id. If no connection given, closes all sessions.

Useful for a shutdown process. Closes all sessions for a given connection-id.
If no connection given, closes all sessions.
raw docstring

closed?clj/s

(closed? session)

current-dbclj/s

(current-db session)

Gets the latest db from the central DB atom if available, or loads it from scratch. DB is returned as a core async promise channel.

Gets the latest db from the central DB atom if available, or loads it from scratch.
DB is returned as a core async promise channel.
raw docstring

dbclj/s

(db conn ledger opts)

Returns core async channel containing current db

Returns core async channel containing current db
raw docstring

DbSessionclj/s


indexedclj/s

(indexed session)

Returns block of last indexed block, but only for indexing done by this server.

Returns block of last indexed block, but only for indexing done by this server.
raw docstring

indexing?clj/s

(indexing? session)

Returns block currently being indexed (truthy), or nil (falsey) if not currently indexing.

Returns block currently being indexed (truthy), or nil (falsey) if not currently indexing.
raw docstring

ledger-alias->idclj/s

(ledger-alias->id conn network alias)

Returns ledger id from alias.

Returns ledger id from alias.
raw docstring

monitor-txclj/s

(monitor-tx session tid key f)

Adds a callback function to call when we see a completed transaction in a block for the given tid.

Key is any arbitrary key provided that allows the callback to be unregistered later with monitor-tx-remove. It must be unique.

Adds a callback function to call when we see a completed transaction in a block
for the given tid.

Key is any arbitrary key provided that allows the callback to be unregistered later
with monitor-tx-remove. It must be unique.
raw docstring

monitor-tx-removeclj/s

(monitor-tx-remove session tid key)

Removes callback from supplied transaction id and key.

Will return true if callback successfully removed, else false if callback didn't exist.

Removes callback from supplied transaction id and key.

Will return true if callback successfully removed, else false if
callback didn't exist.
raw docstring

process-ledger-updateclj/smultimethod


release-indexing-lock!clj/s

(release-indexing-lock! session block)

Releases indexing lock, and updates the last indexed value on the connection with provided block number.

Releases indexing lock, and updates the last indexed value on the connection with provided block number.
raw docstring

reload-db!clj/s

(reload-db! session)

Clears any current db that is cached and forces a db reload.

Clears any current db that is cached and forces a db reload.
raw docstring

remove-cache!clj/s

(remove-cache! network dbid)

Removes a specific session from cache.

Removes a specific session from cache.
raw docstring

reset-cache!clj/s

(reset-cache!)

Clears entire session cache. Should not be used under normal circumstances as sessions will not be properly closed.

Clears entire session cache. Should not be used under normal circumstances as sessions will not be properly closed.
raw docstring

resolve-ledgerclj/s

(resolve-ledger conn ledger)

Resolves a ledger identity in the form of 'network/alias' and returns a two-tuple of [network ledger-id].

An alias lookup is always performed first, and if an alias doesn't exist it is assumed the provided name is a ledger-id.

If you are providing a ledger-id, and wish to skip an alias lookup, a prefix of '$' can be used for the name portion of the ledger.

i.e.

  • testnet/testledger - Look for ledger with an alias testledger on network testnet.
  • testnet/$testledger - look for a ledger with id testledger on network testnet (skip alias lookup).
  • [testnet testledger] - already in form of [network ledger-id]
Resolves a ledger identity in the form of 'network/alias' and returns a
two-tuple of [network ledger-id].

An alias lookup is always performed first, and if an alias doesn't exist it is assumed
the provided name is a ledger-id.

If you are providing a ledger-id, and wish to skip an alias lookup, a prefix of '$'
can be used for the name portion of the ledger.

i.e.
- testnet/testledger - Look for ledger with an alias testledger on network testnet.
- testnet/$testledger - look for a ledger with id testledger on network testnet (skip alias lookup).
- [testnet testledger] - already in form of [network ledger-id]
raw docstring

sessionclj/s

(session conn ledger)
(session conn ledger {:keys [state connect? auth jwt]})

Returns connection to the given ledger, and ensures it is cached.

If 'state' is provided, it will get merged into the connection's state. Use namespaced keys, so as to not to create a conflict with system state keys.

Options supported:

  • connect? - attempts to create a streaming connection to db - will fail if db does not exist - ensure is 'false' if trying to create a new db that does not yet exist.
  • state - initial state map to use
  • auth - the auth
  • jwt - jwt from password login
Returns connection to the given ledger, and ensures it is cached.

If 'state' is provided, it will get merged into the connection's state.
Use namespaced keys, so as to not to create a conflict with system state keys.

Options supported:
- connect? - attempts to create a streaming connection to db - will fail if db does not exist
           - ensure is 'false' if trying to create a new db that does not yet exist.
- state    - initial state map to use
- auth     - the auth
- jwt      - jwt from password login
raw docstring

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

× close