Class: LokiMemoryAdapter

LokiMemoryAdapter(optionsopt)

new LokiMemoryAdapter(optionsopt)

In in-memory persistence adapter for an in-memory database. This simple 'key/value' adapter is intended for unit testing and diagnostics.

Parameters:
Name Type Attributes Description
options object <optional>

memory adapter options

Properties
Name Type Attributes Default Description
asyncResponses boolean <optional>
false

whether callbacks are invoked asynchronously

asyncTimeout int <optional>
50

timeout in ms to queue callbacks

Source:

Methods

deleteDatabase(dbname, callback)

Deletes a database from its in-memory store.

Parameters:
Name Type Description
dbname string

name of the database (filename/keyname)

callback function

function to call when done

Source:

loadDatabase(dbname, callback)

Loads a serialized database from its in-memory store. (Loki persistence adapter interface function)

Parameters:
Name Type Description
dbname string

name of the database (filename/keyname)

callback function

adapter callback to return load result to caller

Source:

saveDatabase(dbname, callback)

Saves a serialized database to its in-memory store. (Loki persistence adapter interface function)

Parameters:
Name Type Description
dbname string

name of the database (filename/keyname)

callback function

adapter callback to return load result to caller

Source: