From 9ef7db99258cc39dd3417f7501c5a799cc2b37ee Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 2 Aug 2023 13:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=AE=A2=E9=98=85=E5=90=8E?= =?UTF-8?q?=E7=A7=BB=E9=99=A4Subscription?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlgraphic/message/CentrifugeBroker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jlgraphic/message/CentrifugeBroker.ts b/src/jlgraphic/message/CentrifugeBroker.ts index 3e9b1a7..9bb13c0 100644 --- a/src/jlgraphic/message/CentrifugeBroker.ts +++ b/src/jlgraphic/message/CentrifugeBroker.ts @@ -66,6 +66,10 @@ export class CentrifugeMessagingClient extends MessageClient { .on('subscribed', (ctx) => { console.log('订阅centrifuge服务消息成功', destination, ctx); }) + .on('unsubscribed', (ctx) => { + this.cli.removeSubscription(sub); + console.log('取消订阅centrifuge服务消息成功', destination, ctx); + }) .subscribe(); } else { sub.subscribe();