Skip to content

Commit

Permalink
Remove duplicate notification of SseBroadcaster's onErrorListeners
Browse files Browse the repository at this point in the history
Follow-up to #30686

(cherry picked from commit 5691787)
  • Loading branch information
Foobartender authored and gsmet committed Feb 7, 2023
1 parent 945459a commit dfe2afa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,4 @@ synchronized void fireClose(SseEventSinkImpl sseEventSink) {
listener.accept(sseEventSink);
}
}

synchronized void fireException(SseEventSinkImpl sseEventSink, Throwable t) {
for (BiConsumer<SseEventSink, Throwable> listener : onErrorListeners) {
listener.accept(sseEventSink, t);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,7 @@ public CompletionStage<?> send(OutboundSseEvent event) {
if (isClosed())
throw new IllegalStateException("Already closed");
// NOTE: we can't cast event to OutboundSseEventImpl because the TCK sends us its own subclass
CompletionStage<?> ret = SseUtil.send(context, event, Collections.emptyList());
if (broadcaster != null) {
return ret.whenComplete((value, x) -> {
if (x != null) {
broadcaster.fireException(this, x);
}
});
}
return ret;
return SseUtil.send(context, event, Collections.emptyList());
}

@Override
Expand Down

0 comments on commit dfe2afa

Please sign in to comment.