Suite of AT Protocol TypeScript libraries built on web standards
20
fork

Configure Feed

Select the types of activity you want to include in your feed.

bump

+9 -6
+1 -1
sync/deno.json
··· 1 1 { 2 2 "name": "@atp/sync", 3 - "version": "0.1.0-alpha.3", 3 + "version": "0.1.0-alpha.4", 4 4 "exports": "./mod.ts", 5 5 "license": "MIT", 6 6 "imports": {
+8 -5
sync/runner/memory-runner.ts
··· 12 12 // A queue with arbitrarily many partitions, each processing work sequentially. 13 13 // Partitions are created lazily and taken out of memory when they go idle. 14 14 export class MemoryRunner implements EventRunner { 15 - consecutive = new ConsecutiveList<number>(); 15 + consecutive: ConsecutiveList<number> = new ConsecutiveList<number>(); 16 16 mainQueue: PQueue; 17 - partitions = new Map<string, PQueue>(); 17 + partitions: Map<string, PQueue> = new Map<string, PQueue>(); 18 18 cursor: number | undefined; 19 19 private lastCursorSave = 0; 20 20 private savingCursor = false; ··· 24 24 this.cursor = opts.startCursor; 25 25 } 26 26 27 - getCursor() { 27 + getCursor(): number | undefined { 28 28 return this.cursor; 29 29 } 30 30 31 - addTask(partitionId: string, task: () => Promise<void>) { 31 + async addTask( 32 + partitionId: string, 33 + task: () => Promise<void>, 34 + ): Promise<void> { 32 35 if (this.mainQueue.isPaused) return; 33 - return this.mainQueue.add(() => { 36 + return await this.mainQueue.add(() => { 34 37 return this.getPartition(partitionId).add(task); 35 38 }); 36 39 }