@speckle/objectloader2
Version:
This is an updated objectloader for the Speckle viewer written in typescript
65 lines (57 loc) • 1.86 kB
text/typescript
import { Database } from '../operations/interfaces.js'
import { CacheOptions } from '../operations/options.js'
import { Base, CustomLogger, Item } from '../types/types.js'
import BatchingQueue from './batchingQueue.js'
import { DefermentManager } from './defermentManager.js'
export class CacheReader {
constructor(
database: Database,
defermentManager: DefermentManager,
options: CacheOptions
) {
this.
this.
this.
this.
}
async getObject(params: { id: string }): Promise<Base> {
if (!this.
this.
}
return await this.
}
if (!this.
this.
batchSize: this.
maxWaitTime: this.
processFunction: this.
})
}
if (!this.
this.
}
}
async getAll(keys: string[]): Promise<(Item | undefined)[]> {
return this.
}
const items = await this.
for (let i = 0; i < items.length; i++) {
if (items[i]) {
this.
} else {
//this is okay!
//this.#logger(`Item ${batch[i]} not found in cache`)
}
}
}
async disposeAsync(): Promise<void> {
await this.
}
}