feat(nbstore): add nbstore worker (#9185)

This commit is contained in:
EYHN
2024-12-20 08:01:23 +00:00
parent 30200ff86d
commit cbaf35df0b
51 changed files with 1144 additions and 501 deletions
@@ -51,10 +51,10 @@ export class AwarenessFrontend {
applyAwarenessUpdate(awareness, update.bin, origin);
};
const handleSyncCollect = () => {
return {
return Promise.resolve({
docId: awareness.doc.guid,
bin: encodeAwarenessUpdate(awareness, [awareness.clientID]),
};
});
};
const unsubscribe = this.sync.subscribeUpdate(
awareness.doc.guid,
+2 -2
View File
@@ -17,7 +17,7 @@ export class BlobFrontend {
return this.sync ? this.sync.uploadBlob(blob) : this.storage.set(blob);
}
addPriority(id: string, priority: number) {
return this.sync?.addPriority(id, priority);
addPriority(_id: string, _priority: number) {
// not support yet
}
}
+1 -2
View File
@@ -37,7 +37,7 @@ interface DocFrontendOptions {
}
export class DocFrontend {
private readonly uniqueId = `frontend:${this.storage.peer}:${nanoid()}`;
private readonly uniqueId = `frontend:${nanoid()}`;
private readonly prioritySettings = new Map<string, number>();
@@ -88,7 +88,6 @@ export class DocFrontend {
}),
]);
// eslint-disable-next-line no-constant-condition
while (true) {
throwIfAborted(signal);
const docId = await this.status.jobDocQueue.asyncPop(signal);