Skip to content

Commit

Permalink
Merge pull request #30767 from Foobartender/#30681.2
Browse files Browse the repository at this point in the history
Remove duplicate notification of SseBroadcaster's onErrorListeners
  • Loading branch information
geoand authored Feb 7, 2023
2 parents 97ca0fe + 5691787 commit e664271
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 @@ -127,11 +127,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 e664271

Please sign in to comment.