Skip to content

Commit

Permalink
Consistently publish events from CompletableFuture
Browse files Browse the repository at this point in the history
Closes gh-30578

(cherry picked from commit b738a20)
  • Loading branch information
jhoeller committed Jun 2, 2023
1 parent 7dae3af commit 1240fb6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ else if (result instanceof CompletionStage) {
handleAsyncError(ex);
}
else if (event != null) {
publishEvent(event);
publishEvents(event);
}
});
}
Expand Down Expand Up @@ -468,6 +468,9 @@ public String toString() {
}


/**
* Inner class to avoid a hard dependency on the Reactive Streams API at runtime.
*/
private class ReactiveResultHandler {

public boolean subscribeToPublisher(Object result) {
Expand All @@ -481,6 +484,9 @@ public boolean subscribeToPublisher(Object result) {
}


/**
* Reactive Streams Subscriber for publishing follow-up events.
*/
private class EventPublicationSubscriber implements Subscriber<Object> {

@Override
Expand Down

0 comments on commit 1240fb6

Please sign in to comment.