tsukinaha / tsukimi

A simple third-party Emby client
GNU General Public License v3.0
878 stars 24 forks source link

chore: reuse reqwest::Client #26

Closed amtoaer closed 5 months ago

amtoaer commented 5 months ago

ReqClient::new() 会构造 reqwest::Client 实例。参考 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.

可以直接 clone 或者全局单例以复用 Client,因此参考上面的 runtime 实现 client 单例。

tsukinaha commented 5 months ago

👍