Skip to content

Commit

Permalink
Fix cancellation order in CancellableRateLimitedFluxIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
fcofdez committed Jan 11, 2024
1 parent a8d0e9c commit a318cad
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ public void onNext(T element) {
}

public void cancel() {
done = true;
cancelSubscription();
clearQueue();
done = true;
// cancel should be called from the consumer
// thread, but to avoid potential deadlocks
// we just try to release a possibly blocked
Expand All @@ -177,9 +177,9 @@ public void cancel() {

@Override
public void onError(Throwable t) {
done = true;
clearQueue();
error = t;
done = true;
signalConsumer();
}

Expand Down

0 comments on commit a318cad

Please sign in to comment.