请问当部署在tornado上时,有没有全局变量可以获知当前有多少个活跃websocket链接? #307
honesthnter
started this conversation in
General
Replies: 2 comments
-
活跃的websocket链接基本上等于活跃的会话,活跃的会话数量可以使用以下代码统计: from pywebio.session import ThreadBasedSession
len(set(id(s) for s in ThreadBasedSession.thread2session.values())) |
Beta Was this translation helpful? Give feedback.
0 replies
-
或者也可以通过使用 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
请问当部署在tornado上时,有没有全局变量可以获知当前有多少个活跃websocket链接?
Beta Was this translation helpful? Give feedback.
All reactions