Closed amtoaer closed 5 months ago
ReqClient::new() 会构造 reqwest::Client 实例。参考 reqwest::Client 文档页:
ReqClient::new()
reqwest::Client
The Client holds a connection pool internally, so it is advised that you create one and reuse it. You do not have to wrap the Client in an Rc or Arc to reuse it, because it already uses an Arc internally.
The Client holds a connection pool internally, so it is advised that you create one and reuse it.
You do not have to wrap the Client in an Rc or Arc to reuse it, because it already uses an Arc internally.
可以直接 clone 或者全局单例以复用 Client,因此参考上面的 runtime 实现 client 单例。
👍
ReqClient::new()
会构造reqwest::Client
实例。参考 reqwest::Client 文档页:可以直接 clone 或者全局单例以复用 Client,因此参考上面的 runtime 实现 client 单例。