Skip to content

Commit

Permalink
Merge pull request #177 from smallrye/cs-publisher-cancellation-fix
Browse files Browse the repository at this point in the history
Add a C&S step for CompletionStagePublisher cancellation
  • Loading branch information
jponge authored Mar 14, 2024
2 parents 2053e75 + b5d31a8 commit 3608cb9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ public void request(long n) {

@Override
public void cancel() {
cancelled.set(true);
completableFuture.toCompletableFuture().cancel(false);
if (cancelled.compareAndSet(false, true)) {
completableFuture.toCompletableFuture().cancel(false);
}
}
}
}

0 comments on commit 3608cb9

Please sign in to comment.