Skip to content

Commit

Permalink
Consistently publish events from CompletableFuture
Browse files Browse the repository at this point in the history
Closes gh-30578
  • Loading branch information
jhoeller committed Jun 2, 2023
1 parent cca8fbd commit b738a20
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<?> completionStage) {
handleAsyncError(ex);
}
else if (event != null) {
publishEvent(event);
publishEvents(event);
}
});
}
Expand Down Expand Up @@ -466,6 +466,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 @@ -479,6 +482,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 b738a20

Please sign in to comment.