Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rglover opened this issue Oct 24, 2023 · 0 comments
Closed

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

rglover opened this issue Oct 24, 2023 · 0 comments
Assignees
Labels
feature Something new to add @joystick.js/node Related to the @joystick.js/node package.

Comments

@rglover
Copy link
Contributor

rglover commented Oct 24, 2023

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.

@rglover rglover added feature Something new to add @joystick.js/node Related to the @joystick.js/node package. labels Oct 24, 2023
@rglover rglover self-assigned this Oct 24, 2023
@rglover rglover closed this as completed Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Something new to add @joystick.js/node Related to the @joystick.js/node package.
Projects
None yet
Development

No branches or pull requests

1 participant