feat: use worker relay for events cache

This commit is contained in:
2024-01-18 21:11:48 +00:00
parent c2f78dad1e
commit 32a6d56cf5
16 changed files with 172 additions and 330 deletions

View File

@ -56,6 +56,10 @@ export class WorkerRelayInterface {
return (await this.#workerRpc<void, Uint8Array>("dumpDb")).result;
}
async sql(sql: string, params: Array<string | number>) {
return (await this.#workerRpc<object, Array<Array<any>>>("sql", { sql, params })).result;
}
#workerRpc<T, R>(cmd: string, args?: T, timeout = 30_000) {
const id = uuid();
const msg = {