hi,
i got these crazy ideas but i think it is great for some use cases.
job substitution
let us say that you have the following simple job
public class SimpleJob{
public void SayHello(){
console.write("hello");
}
}
then later i update the above to
public class SimpleJob{
public void SayHello(string name){
console.write("hello")+ name;
}
}
it would be awesome if Hangfire can detect the new changes and any waiting jobs in the queue will be updated with the new code.
maybe it is already how hangfire works, i am not that smart
another idea is job migration
sometimes you don’t want to cancel jobs in queue but like above your code has changed or you completely created new class, so if we can add for example a migration attribute to the job, this way any jobs in the queue will smartly execute the new code.
another idea is job priority for individual jobs and groups.
sometimes you want to register a user, and you have 3 steps, first add to DB, secondly provision user, thirdly send an email. ofcourse you can put all these steps in one code, but separation is good, so we can split the above into 3 jobs and execute them by order, the benefit is for example, the adding user to db job succeeded, but provisioning failed, no problem Hangfire will only retry the second job. but if all this was in one job, hangfire will retry everything, or we have to make code checkups manually.
depend on
now this is cool, we add depend on attribute, and hangfire will keep this job in queue until the job it depends on get executed, if the the dependent on job is not executed, hangfire will keep this job in queue with some hint like “waiting for job #23232323 to be executed”.