Ordering tasks by a key #148
|
Hey 👋🏻 Is it possible to have an ordering mechanism that uses a "key" as a lock id? I have a requirement where I need to process tasks ordered by a key. Currently I am using python procrastinate library which has a cool ordering mechanism that works perfectly, but this forces me to use python and all my other system are typescript based. My context: |
Answered by
GiovaniGuizzo
Dec 23, 2025
Replies: 1 comment 1 reply
|
Hey Eric. No, unfortunately, there is no way to guarantee that with Sidequest using keys or specific mechanisms. What you can do is schedule a job from within another job, something like this: export class ProcessClipJob extends Job {
async run(id: number) {
// Process job here
if (success) {
await Sidequest.build(ProcessClipJob).enqueue(id + 1);
}
}
}This way you will be sure that they are processed in sequence. |
1 reply
Answer selected by
ericsouza
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Eric. No, unfortunately, there is no way to guarantee that with Sidequest using keys or specific mechanisms.
What you can do is schedule a job from within another job, something like this:
This way you will be sure that they are processed in sequence.