News for hackers. Stuff that matters.
Re:A job queue in two lines of JavaScript by theThree on Monday July 14, 2025 @12:22AM (#44556431)
Something like this?

async function runTasks(tasks: Job[]) { for (let task of tasks) { try { await task() } catch (e) { } } }

Re:A job queue in two lines of JavaScript by foxygen on Monday July 14, 2025 @01:12AM (#44556681)
This only works if you have the full list of tasks beforehand.