The doc snippet incorrectly registers the whenSent action after sending the response. This (probably) would work in 3.x with the reactive non-blocking style but in 4.x, virtual threads, and blocking it no longer works when done this way.
This PR changes the snippet so it invokes whenSentbefore sending the response.
I looked for and did not find other incorrect uses of whenSent in other snippets or in examples.
Description
Resolves #8875
The doc snippet incorrectly registers the
whenSent
action after sending the response. This (probably) would work in 3.x with the reactive non-blocking style but in 4.x, virtual threads, and blocking it no longer works when done this way.This PR changes the snippet so it invokes
whenSent
before sending the response.I looked for and did not find other incorrect uses of
whenSent
in other snippets or in examples.Documentation
This is a doc bug.