const batchQueue = new BatchQueue(100)
const data = await response.json() as ApiResponse[];
let processedCount = 0;
this.batchQueue.queue(
...data.map((spin) => async () => {
try {
await this.processSpin(spin);
processedCount++;
} catch (error) {
console.error(error);
}
}),
);
await this.batchQueue.run();
const batchQueue = new BatchQueue(100)
const data = await response.json() as ApiResponse[];
let processedCount = 0;
this.batchQueue.queue(
...data.map((spin) => async () => {
try {
await this.processSpin(spin);
processedCount++;
} catch (error) {
console.error(error);
}
}),
);
await this.batchQueue.run();