seperating batch payload from job queue

This commit is contained in:
Boki 2025-06-10 09:58:20 -04:00
parent c57733ebca
commit b974753d8b
5 changed files with 360 additions and 25 deletions

View file

@ -256,4 +256,25 @@ export class MemoryCache implements CacheProvider {
}
return bytes;
}
async waitForReady(timeout: number = 5000): Promise<void> {
// Memory cache is always ready immediately
return Promise.resolve();
}
isReady(): boolean {
// Memory cache is always ready
return true;
}
private getMemoryUsage(): number {
// Rough estimation of memory usage in bytes
let bytes = 0;
for (const [key, entry] of this.store.entries()) {
bytes += key.length * 2; // UTF-16 characters
bytes += JSON.stringify(entry.value).length * 2;
bytes += 24; // Overhead for entry object
}
return bytes;
}
}