-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Allow for Immediate Rejection #53
Comments
That sounds very reasonable. I can easily imagine that there would be the case you know retry wouldn't work for the certain situation. I would suggest to simply use What do you think @IanLuites @ricardoperez @Losco @elliotthilaire? |
@ono Yeah, that was what we initially thought, but wanted to make a suggestion with the least impact on existing code. Having the match in https://github.com/shinyscorpion/task_bunny/blob/master/lib/task_bunny/job_runner.ex#L59-L63 definitely seems cleaner. |
@erikreedstrom The ability to handle |
We have use cases where the result of a job may be a failure, but there is no need to retry based on the response. In these cases, we'd like to immediately reject. This will allow us to lower our throughput to rate limited services.
Currently, the code rejects only based on a condition of failure count equaling or exceeding max retries.
See: https://github.com/shinyscorpion/task_bunny/blob/master/lib/task_bunn/worker.ex#L246
Although this works for normal unexpected returns, we suggest adding an additional handler for rejecting explicitly. Specifically, we could handle with two additional function heads:
The handler has an additional match on
:reject
or{:reject, job_error}
, directing the process to immediately reject the message where either is returned by the job invocation.The text was updated successfully, but these errors were encountered: