Skip to content

Commit e71248f

Browse files
author
Nickolay Savchenko
committed
Fix unsubscribe
1 parent 1003a32 commit e71248f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/src/main/java/ua/naiksoftware/stomp/StompClient.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,7 @@ public Completable send(String destination, String data) {
174174
public Completable send(@NonNull StompMessage stompMessage) {
175175
Completable completable = connectionProvider.send(stompMessage.compile(legacyWhitespace));
176176
CompletableSource connectionComplete = getConnectionStream()
177-
// .filter(isConnected -> isConnected)
178-
.filter(isConnected -> {
179-
Log.d(TAG, "Send " + stompMessage + "filtered " + isConnected);
180-
return isConnected;
181-
})
177+
.filter(isConnected -> isConnected)
182178
.firstElement().ignoreElement();
183179
return completable
184180
.startWith(connectionComplete);
@@ -248,8 +244,7 @@ else if (!streamMap.containsKey(destPath))
248244
getMessageStream()
249245
.filter(msg -> pathMatcher.matches(destPath, msg))
250246
.toFlowable(BackpressureStrategy.BUFFER)
251-
.doFinally(() -> unsubscribePath(destPath).subscribe())
252-
.share())
247+
.share()).doFinally(() -> unsubscribePath(destPath).subscribe())
253248
);
254249
return streamMap.get(destPath);
255250
}

0 commit comments

Comments
 (0)