question

ZongwenFeng-0959 avatar image
0 Votes"
ZongwenFeng-0959 asked ZongwenFeng-0959 commented

how to close PubSub connections on demand

Since PubSub has a connection limit count, I want to manage the connections and close the ones that is not needed any more. This is necessary as we can't depend on the client side to close the connection voluntarily.

I am ware that through the WebHook, I can collect all the connection IDs on the event [azure.webpubsub.sys.connected], and then I can choose to close some connections as needed. However, I will have to maintain those connection IDs.

Is there any way to close all the connections for a given UserId? The SDK only provides the capability to close a connection by connection ID.

Alternatively, is there a way to get the list of active connections for a given User ID? I really don't want to maintain those connection IDs. It feels like it should be the responsibility of the PubSub service.

Thanks!

azure-web-pubsub
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ChenyangLiu-2226 avatar image
0 Votes"
ChenyangLiu-2226 answered ZongwenFeng-0959 commented

Currently, we don't provide mechanism to close by user-id or get connection-id by user-id. But we think it makes sense to provide a RestAPI to close by user-id. We will put it on our roadmap.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It's great to hear that. Looking forward to the new update!

0 Votes 0 ·