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: |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
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.