Hi, new proletarian user, is it possible to have the queue processed in order only once a job is successful, so that if I have A,B,C are in the queue B will only be processed once A is successful, C will only be processed once B is successful ?
I can make it work with a 1 worker-thread and returning a negative :delays from the :retry-strategy-fn, but this required removing the :pre condition on proletarian.retry/retry-data is this something that would be considered or too outside the intent of this lib ?
Thank you, I was trying to simulate rabbitmq's ack/nack which allows putting a job that "temporarily failed" (like 429 on a service call) back at the top of the queue (nack) so that it will be picked up again, by the single consumer of that queue, until it succeeds (ack). This effectively blockes the queue until the job is successful. In my use case I needed all the jobs to be processed but in order, with a specific delay between calls to an api and to always retry for recoverable errros (like network problem).
If you want no retries for you jobs, then the correct way to that is to not provide a retry-strategy-fn when creating the worker. Then jobs won't be retried.
But the way Proletarian works is that failed jobs are recorded in the archive table, and then the next job in the queue is processed. So in your example and with a setup of one worker-thread (on one instance) job B will be processed after job A regardless of the outcome of job A. The way to guarantee that B only will run after A is successful is to enqueue B in job A.