-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于Xrpc的XRPCServer.EventToken设计解耦的问题 #24
Comments
我的简单实现。已经测试可以用
|
这个主要看控制器的实例模式吧,如果每次调用都实例化这种设计是可行,如果是单实例则不好用了。 |
单实例的话,就不用创建对象了,找到最前面第一次创建的对象,更新当前的连接信息即可。 |
单实例是所有用户共享实例,无法直接更新,这样会存在线程安全问题。 |
那就单例模式下不允许这么做。实例模式下才允许 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
现有的是通过唯一的静态属性
XRPCServer.EventToken
去获取当前的连接信息的。不够优雅~~我有个思路,你看下:
The text was updated successfully, but these errors were encountered: