We have a SAAS system with several hundred customers. We use Hangfire for all kinds of processes such as sending an email.
We have a problem with the following scenario:
Customer 1: create 10000 jobs
Customer 2: create 3 jobs
In this case, customer 2 created the jobs a second after customer 1, but he has to wait in the queue for the entire time it will take for the system to generate the processes of customer 1 because the queue looks like this:
job 1 customer 1
job 2 customer 1
…
job 10000 customer 1
job 1 customer 2
job 2 customer 2
job 3 customer 2
Is there a way to change the existing queue or do something in a different way so that the order in exporting the jobs is:
job 1 customer 1
job 1 customer 2
job 2 customer 1
job 2 customer 2
job 3 customer 1
job 3 customer 2
…
job 10000 customer 1
I thought of creating a separate queue for each customer but then customers whose name starts with A will get priority over customers whose name starts with Z.
Maybe the solution to this is creating a queue without priority? Is it possible?
If not, is there a way to edit an existing queue or insert jobs into the queue in the middle and not at the end?