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 quarkusio#30686
  • Loading branch information
Foobartender committed Feb 1, 2023
1 parent 6e7006f commit 73c05e0
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 73c05e0

Please sign in to comment.