@atproto/sync
Version:
atproto sync library
25 lines • 925 B
TypeScript
import PQueue from 'p-queue';
import { ConsecutiveList } from './consecutive-list.js';
import { EventRunner } from './types.js';
export type MemoryRunnerOptions = {
setCursor?: (cursor: number) => Promise<void>;
concurrency?: number;
startCursor?: number;
};
type Queue = InstanceType<typeof PQueue>;
export declare class MemoryRunner implements EventRunner {
opts: MemoryRunnerOptions;
consecutive: ConsecutiveList<number>;
mainQueue: Queue;
partitions: Map<string, Queue>;
cursor: number | undefined;
constructor(opts?: MemoryRunnerOptions);
getCursor(): number | undefined;
addTask(partitionId: string, task: () => Promise<void>): Promise<void>;
private getPartition;
trackEvent(did: string, seq: number, handler: () => Promise<void>): Promise<void>;
processAll(): Promise<void>;
destroy(): Promise<void>;
}
export {};
//# sourceMappingURL=memory-runner.d.ts.map