Skip to content

Commit

Permalink
[RESTEASY-1680]:Close all subscribed SseEventSink instances when clos…
Browse files Browse the repository at this point in the history
…e SseBroadCaster
  • Loading branch information
jimma authored and asoldano committed Jan 15, 2018
1 parent 50f15af commit 42a76bf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

Expand All @@ -26,7 +25,9 @@ public SseBroadcasterImpl () {
@Override
public void close()
{
outputQueue.forEach(evenSink -> {closeConsumers.forEach(consumer-> {consumer.accept(evenSink);});});
//Javadoc says close the broadcaster and all subscribed {@link SseEventSink} instances.
//is it necessay to close the subsribed SseEventSink ?
outputQueue.forEach(evenSink -> {evenSink.close(); closeConsumers.forEach(consumer-> {consumer.accept(evenSink);});});
outputQueue.clear();
}

Expand Down

0 comments on commit 42a76bf

Please sign in to comment.