We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
新增一个应用级很可用的 example,不少用户在方法级构建客户端调 api 就完事了,这样不符合用法。
需要有样例长久持有 client 并添加注释描述清楚。
一般大部分情况下,应用下仅需一个客户端,而且需要长期持有直至应用停止。 因为它内部会初始化与服务端的长链接,后续的数据交互及变更订阅,都是实时地通过长链接告知客户端的。
The text was updated successfully, but these errors were encountered:
刚刚遇到类似问题,通过Arc::new(Box::new(config_service)); 封装config_service到全局State中就可以了。
Sorry, something went wrong.
@bell152 现在用 std::sync::LazyLock 也很不错
std::sync::LazyLock
No branches or pull requests
新增一个应用级很可用的 example,不少用户在方法级构建客户端调 api 就完事了,这样不符合用法。
需要有样例长久持有 client 并添加注释描述清楚。
The text was updated successfully, but these errors were encountered: