queue

Source queue

The evan queue is a global data handler for data synchronisation, for multiple DApp cross usage. It provides functions to save data entries and metadata globally within an browser indexDB.

Be ware: Its not a final implementation of data saving into the blockchain. The dapp-browser handles only a initialized blockchain-core instance without any profile interaction. As a result of this, the queue synchronisation must be handle by the DApps. For a sample implementation for Angular 5, have a look at angular-core queue-service (including QueueSequences, -Entries, Ids and QueueDispatchers) and angular-core dapp-wrapper component (for implementation reference, have a look at angular queue tutorial)


entries

queue.entries

global available queue instances


queueDB

queue.queueDB

initialized queue database


lastAccountId

queue.lastAccountId

save the last account id to check, for which account the queue was loaded


getStorageName

queue.getStorageName();

gets the queue db storage name for the active account

Returns

string: The storage name.

Example

queue.getStorageName() // => 'evan-queue-${ activeAccountId }'

getObjectStore

queue.getObjectStore(option);

Gets the “evan-queue” object store

Parameters

  1. option - any: dditional options for transaction

Returns

any: The object store.

Example

const objectStore = getObjectStore();
const request = objectStore.get(accountId);

updateQueue

queue.updateQueue(arguments);

Loads the queue db for the current user and updates all global queue entries from the index db

Returns

Promise returns Array<any>: global queue entry array

Example

queue.updateQueue();

storeQueue

queue.storeQueue(queueEntries);

Function description

Parameters

  1. queueEntries - Array<any>: queue entries to save

Returns

Promise returns any: objectStore.put result

Example

await queue.storeQueue(queue.entries);