Background.Enqueue() with the specified position

How do I specify the position when call Background.Enqueue()

ex. in default queue, there are three jobs C B A (last → first)

Then, I want to enqueue D to the default queue at first position.

Like C B A D (last → first)

not D C B A (last → first)

If you’re queuing the jobs at the same time you can use ContinueWith to require one job to finish before another is available (on the queue). If you’re talking about after the fact, it’s not designed for that. I would think you’d have to modify the date stamp on the job but that may not be reliable.

2 Likes

What I need is to enqueue a job at the specified position, so ContinueWith isn’t what I want :joy:

It’s not designed for that and I don’t think I’ve seen a job processing system/unit of work service that would allow for that. I would rethink the process to know what needs to be done at the time the jobs are enqueued.