Home Reference Source
public class | source

Storage

Extends:

EventEmitter → Storage

Constructor Summary

Public Constructor
public

constructor(options: StorageOptions)

Member Summary

Public Members
public

if there are no efficient way of checking update, make a warning notification once

public

Name of collection.

public

Connection string for storage.

public

lookup: *

public

id field of record

public

timeout: *

update check timeout object

public

Minimum duration between updates in ms

public

Maximum duration between updates in ms

public

Rate at which update checks are slowed down when there are no updates.

Method Summary

Public Methods
public

async connect()

Connect to data storage

public abstract

async createRecord(record: *)

public abstract

async deleteRecord(record: *)

public abstract

async readAllRecords(): Array<Record>

public abstract

async readRecord(record: *)

public

Start checking for updates.

public

Stop checking for updates.

public abstract

async updateCheckImpl(): *

Implmentation of update checking.

public abstract

async updateRecord(record: *)

Public Constructors

public constructor(options: StorageOptions) source

Params:

NameTypeAttributeDescription
options StorageOptions

see fields

Public Members

public bruteForceNotified: boolean source

if there are no efficient way of checking update, make a warning notification once

public collectionName: * source

Name of collection. Derived from connection string if there is # based seperation.

public connectionString: * source

Connection string for storage. e.g. for FSStorage, it is a path

public lookup: * source

public primaryKey: * source

id field of record

public timeout: * source

update check timeout object

public updateInterval: number source

Minimum duration between updates in ms

public updateIntervalMax: number source

Maximum duration between updates in ms

public updateIntervalSlowdownRate: number source

Rate at which update checks are slowed down when there are no updates.

Public Methods

public async connect() source

Connect to data storage

public abstract async createRecord(record: *) source

Params:

NameTypeAttributeDescription
record *

public abstract async deleteRecord(record: *) source

Params:

NameTypeAttributeDescription
record *

public abstract async readAllRecords(): Array<Record> source

Return:

Array<Record>

public abstract async readRecord(record: *) source

Params:

NameTypeAttributeDescription
record *

public startRecordUpdateCheck() source

Start checking for updates. Emit events when there are updates. Required for use with CachedCollection

public stopRecordUpdateCheck() source

Stop checking for updates. Required for use with CachedCollection

public abstract async updateCheckImpl(): * source

Implmentation of update checking.

Override this if storage has more efficient way of checking for updates.

Return:

*

public abstract async updateRecord(record: *) source

Params:

NameTypeAttributeDescription
record *