Unsubscribe receive if jsonRpcSender channel is closed

This commit is contained in:
AsamK committed 2022-06-08 17:51:18 +02:00
1 parent 7bf06aef5e
commit c8cd36bde8
2 files changed
+11 -2

No files matched your search

@@ -860,7 +860,8 @@ class ManagerImpl implements Manager {
logger.debug("Starting receiving messages");
context.getReceiveHelper().receiveMessagesContinuously((envelope, e) -> {
synchronized (messageHandlers) {
Stream.concat(messageHandlers.stream(), weakHandlers.stream()).forEach(h -> {
final var handlers = Stream.concat(messageHandlers.stream(), weakHandlers.stream()).toList();
handlers.forEach(h -> {
try {
h.handleMessage(envelope, e);
} catch (Throwable ex) {