SignalR Hub - 检查传入或传出数据
我想实现在关闭服务器之前正确关闭所有 SignalR 集线器的功能,以推出新的应用程序版本。
我希望 REST API 完成所有当前管理的请求,但不接受新请求。这已经实施了。
另外,我想关闭所有集线器。问题是 REST 请求连接在完成后会关闭,因此很容易确定是否仍有必须完成的请求。但集线器连接始终处于活动状态,除非故意关闭或出现问题。
因此,如果当前没有数据传输,我想关闭集线器。有没有办法检查这些信息?
I want to implement the feature to properly shut down all SignalR hubs before shutting down the server, to roll out a new application version.
I want the REST API to finish all currently managed requests but not to accept new requests. That's already implemented.
Also, I want to shut down all hubs. The problem is that a REST requests connection is closed when it's done, so it's easy to determine if there are still requests, that have to be finished. But a Hub connection is always active unless it's closed on purpose or something went wrong.
So I want to shut down the hub if no data is currently transmitted. Is there a way to check for this information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论