Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Adds logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Fortune committed Jan 24, 2024
1 parent 66c43c5 commit b74af5c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ public CompletableFuture<String> subscribe(String type,
*/
@Override
public CompletableFuture<Boolean> unsubscribe(String type, String method, String id) {
log.info("[unsubscribe] Unsubscribing for type={}, method={}, id={}", type, method, id);
val subscription = type + "::" + id;
val whenUnsubscribed = new CompletableFuture<Boolean>();

Expand All @@ -303,12 +304,14 @@ public CompletableFuture<Boolean> unsubscribe(String type, String method, String
// a slight complication in solving - since we cannot rely on the sent id, but rather
// need to find the actual subscription id to map it
if (this.subscriptions.get(subscription) == null) {
log.info("Unable to find active subscription={}", subscription);
log.info("[unsubscribe] Unable to find active subscription={}", subscription);

whenUnsubscribed.complete(false);
} else {
log.info("[unsubscribe] Found active subscription={}", subscription);
this.subscriptions.remove(subscription);
if (this.isConnected() && this.webSocket != null) {
log.info("[unsubscribe] Submitting method={}, id={}", method, id);
return this.send(method, Collections.singletonList(id), null)
.thenApplyAsync(RpcObject::asBoolean);
}
Expand Down

0 comments on commit b74af5c

Please sign in to comment.