You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is how consumeAndCancel is done in the WebClient for example. This isn't too bad but anything using HttpClient would need something similar and arguably Reactor Netty should have official API to encourage good behavior.
Then it gets more tricky if you want to do the same from a place where you don't know if the body has been consumed or not. You've to do something more like this where you try to consume and if an error occurs, suppress it expecting it's probably because the body has been read. This is fragile and could lead to issues like #503 that are very tricky to debug.
It would be useful if such an API provided options for how to drain, e.g. try to consume and if anything comes then cancel (like above), or perhaps allow reading up to a certain amount of data and/or timeout and then cancel.
The text was updated successfully, but these errors were encountered:
This is how consumeAndCancel is done in the
WebClient
for example. This isn't too bad but anything usingHttpClient
would need something similar and arguably Reactor Netty should have official API to encourage good behavior.Then it gets more tricky if you want to do the same from a place where you don't know if the body has been consumed or not. You've to do something more like this where you try to consume and if an error occurs, suppress it expecting it's probably because the body has been read. This is fragile and could lead to issues like #503 that are very tricky to debug.
It would be useful if such an API provided options for how to drain, e.g. try to consume and if anything comes then cancel (like above), or perhaps allow reading up to a certain amount of data and/or timeout and then cancel.
The text was updated successfully, but these errors were encountered: