Interface

Cache

Cache

A cache is responsible for storing and retrieving tapes and ops from a cache, and if necessary instructing an adapter to fetch items from a data source.

A cache must implement all of the following callbacks:

  • fetchTx()
  • fetchTxBy()
  • fetchOps()

Methods

# static fetchOps(refs, opts) → {Promise}

Loads Ops from the cache by the given procedure referneces, or delegates the job to the specified adapter.

Parameters:
Name Type Description
refs Array

Op references

opts Object

Options

View Source operate/cache.js, line 52

Promise

# static fetchTx(txid, opts) → {Promise}

Loads a transaction from the cache by the given txid, or delegates to job to the specified adapter.

Parameters:
Name Type Description
txid String

Transaction id

opts Object

Options

View Source operate/cache.js, line 26

Promise

# static fetchTxBy(query, opts) → {Promise}

Loads a list of transactions from the cache by the given query map, or delegates to job to the specified adapter.

Parameters:
Name Type Description
query Object

Query object

opts Object

Options

View Source operate/cache.js, line 39

Promise