cheatcode / joystick

A full-stack JavaScript framework for building stable, easy-to-maintain apps and websites.
https://cheatcode.co/joystick
Other
209 stars 11 forks source link

Add ability for jobs to be run synchronously in queues #358

Closed rglover closed 2 months ago

rglover commented 11 months ago

This will be a trick. Need to be able to flag a job as sync: true in the job definition. Internally, we want to check and see if the next job to run is sync: true and if it is, check to see if any other jobs of that type are running. If they are, leave the job as pending and move to the next. Once the first is done, then let the job run.

That way, jobs queued near each other don't get into a race condition where they run in parallel and their respective work competes with one another.