helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.44k stars 562 forks source link

Correct the ordering of whenSent in doc snippet #8884

Closed tjquinno closed 2 weeks ago

tjquinno commented 2 weeks ago

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.