Consider the scenario where a client makes a request and a handler starts processing it, but then the client disconnects before receiving the response. Does Axum destroy the task associated with that connection immediately or does it let it continue running?
Whether it does or not effects how this edge case should be handled:
- If the task is cancelled, not all user written code is inherently cancel-safe and would need to be accounted for (either meticulously or just wrapping it in a
spawn). - If the task is not cancelled, the user may want to know that the response will not be received and could stop processing early.
A follow up question: are extractors and middleware handled the same?