mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
feat(core): new worker workspace engine (#9257)
This commit is contained in:
@@ -23,7 +23,6 @@ export class WorkerClient {
|
||||
private readonly client: OpClient<WorkerOps>,
|
||||
options: WorkerInitOptions
|
||||
) {
|
||||
client.listen();
|
||||
this.client.call('worker.init', options).catch(err => {
|
||||
console.error('error initializing worker', err);
|
||||
});
|
||||
@@ -156,7 +155,9 @@ class WorkerBlobStorage implements BlobStorage {
|
||||
class WorkerDocSync implements DocSync {
|
||||
constructor(private readonly client: OpClient<WorkerOps>) {}
|
||||
|
||||
readonly state$ = this.client.ob$('docSync.state');
|
||||
get state$() {
|
||||
return this.client.ob$('docSync.state');
|
||||
}
|
||||
|
||||
docState$(docId: string) {
|
||||
return this.client.ob$('docSync.docState', docId);
|
||||
@@ -174,7 +175,9 @@ class WorkerDocSync implements DocSync {
|
||||
|
||||
class WorkerBlobSync implements BlobSync {
|
||||
constructor(private readonly client: OpClient<WorkerOps>) {}
|
||||
readonly state$ = this.client.ob$('blobSync.state');
|
||||
get state$() {
|
||||
return this.client.ob$('blobSync.state');
|
||||
}
|
||||
setMaxBlobSize(size: number): void {
|
||||
this.client.call('blobSync.setMaxBlobSize', size).catch(err => {
|
||||
console.error('error setting max blob size', err);
|
||||
|
||||
Reference in New Issue
Block a user