beerman
beerman
DDeno
Created by beerman on 1/20/2025 in #help
batching tasks
I'm calling an api and get an array of 2000+ items. I want to chunk these into batches of 100 and then process them all concurrently. I've tried BatchQueue but it looks like it stops after processing only the first batch.
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();
What's the best way to do this preferably without third party modules?
12 replies
DDeno
Created by beerman on 3/16/2023 in #help
Module imported in app successfully, but fails to deploy
1 replies
DDeno
Created by beerman on 2/4/2023 in #help
Is there any way to pause a server on deno deploy?
Need for debugging
2 replies
DDeno
Created by beerman on 1/10/2023 in #help
Trouble importing npm modules
11 replies
DDeno
Created by beerman on 1/9/2023 in #help
Trouble importing modules
3 replies
DDeno
Created by beerman on 11/10/2022 in #help
axios gives me a CORS error, fetch doesn't. Why is that?
64 replies
DDeno
Created by beerman on 11/7/2022 in #help
Learning how this works under the hood
Recommended resources to learn how this stuff works that can be understood by a dummy without a background in computer science? For a guy like me, becoming proficient at coding amounted to more or less like learning what goes with what and remembering how to get things to happen. I'm very limited by my lack of understanding how any of this (runtimes, bundlers, compilers, etc etc) works under the hood. I want to level up.
7 replies
DDeno
Created by beerman on 11/7/2022 in #help
Error The deployment failed Module not found
5 replies