Add onRequestTimeout Directive
- Dominant language
- Scala
- Stars
- 1.4k
- Forks
- 584
- Avg merge
- 14h 33m
- Merged PRs (30d)
- 24
Description
It would be nice if we had a directive that allowed us to side-effect when a server request timeout occurs. Currently we can do something on `withRequestTimeoutResponse`, but that requires us to supply a response rather than let the timeout handling happen elsewhere.
An example of when this is desirable would be when an external request results in client requests or other streams being run that need to be consumed to supply a response to the request. In this case it's desirable to consume/killswitch those streams when the request times out.
Contributor guide
Research direction
Start by reading the existing `withRequestTimeoutResponse` directive and related request-timeout handling in the Akka HTTP server API. Define how an `onRequestTimeout` directive should trigger side effects while leaving timeout response handling elsewhere, including cancellation or consumption of streams; done means the directive behaves correctly for the described external-request scenario and is covered by relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100