Remove write pausing in Undertow response

Using the simple example shown in the ticket but switching from
Mono<String> to Flux<String> (and 5,000,000 onNext calls) shows that
constant pausing causes significant overhead and is not worth the
trouble vs ignoring the onWritePossible in REQUESTED state.

Issue: SPR-16702
This commit is contained in:
Rossen Stoyanchev 2018-04-11 14:23:16 -04:00
parent 3549745e37
commit 224589ea74
2 changed files with 5 additions and 5 deletions

View File

@ -162,7 +162,11 @@ public abstract class AbstractListenerWriteProcessor<T> implements Processor<T,
* Invoked after the current data has been written and before requesting
* the next item from the upstream, write Publisher.
* <p>The default implementation is a no-op.
* @deprecated originally introduced for Undertow to stop write notifications
* when no data is available, but deprecated as of as of 5.0.6 since constant
* switching on every requested item causes a significant slowdown.
*/
@Deprecated
protected void writingPaused() {
}
@ -271,6 +275,7 @@ public abstract class AbstractListenerWriteProcessor<T> implements Processor<T,
},
RECEIVED {
@SuppressWarnings("deprecation")
@Override
public <T> void onWritePossible(AbstractListenerWriteProcessor<T> processor) {
if (processor.changeState(this, WRITING)) {

View File

@ -217,11 +217,6 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
return (dataBuffer.readableByteCount() == 0);
}
@Override
protected void writingPaused() {
this.channel.suspendWrites();
}
@Override
protected void writingComplete() {
this.channel.getWriteSetter().set(null);