Dynamic service_timeout
tessereth opened this issue · 2 comments
For our rails app, we would like to be able to have a dynamic service_timeout
based on the headers of the request. So I would love to be able to provide a lambda for service_timeout
, something like:
service_timeout: -> (env) { custom_logic }
Is this something you would be interested in including? I'm happy to make a PR, I just wanted to check before I put in the work to write the code.
This could be a solution to both of these other issues as well:
Appears the fork https://github.com/jash-kothari-forks/rack-timeout has the exact behaviour you're looking for
Its 77 commits bit behind master here but wonder if we can get the PR open an into a mergable state.
There's been many requests and several PRs over the years to be able to do this or something similar. The general conclusion has been this is an anti-pattern. The most vigorous debate took place in #110, which I welcome you to review.
I think if we can find a sustainable approach that allows people to customize the behavior, but does not endlessly add more options/option handling, then this might have a future. However, this might require significant refactoring.