Skip to content

Commit

Permalink
Merge branch '5.3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
poutsma committed Oct 28, 2022
2 parents c21bd66 + 4632985 commit 2ccfc70
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ void emitError(Throwable t) {

void requestToken() {
if (upstream() != null &&
this.state.get().canRequest() &&
this.requestOutstanding.compareAndSet(false, true)) {
request(1);
}
Expand Down Expand Up @@ -252,6 +253,13 @@ private interface State {
default void error(Throwable throwable) {
}

/**
* Indicates whether the current state is ready to accept a new token.
*/
default boolean canRequest() {
return true;
}

/**
* Cleans up any state.
*/
Expand Down Expand Up @@ -755,6 +763,11 @@ private Mono<Void> writeInternal(DataBuffer dataBuffer) {
}
}

@Override
public boolean canRequest() {
return false;
}

@Override
public void dispose() {
this.disposed = true;
Expand Down

0 comments on commit 2ccfc70

Please sign in to comment.