Closed open-schnick closed 1 year ago
Since the Client and its children have not a few fields, for example, I think the allocation load to Clone for each request may be large. Currently, though, we would use Arc as follows,
let client = Arc::new(client)
let client_per_each_request = client.clone()
I think it would be nice to have Arc inside as well as other components.
#[derive(Clone)]
pub struct Client {
inner: Arc<InternalClient>
}
struct InternalClient {
default_google_access_id: Option<String>,
default_sign_by: Option<SignBy>,
storage_client: StorageClient, default_account_client: Option<String>,
service_account_client: ServiceAccountClient
}
Sorry for the late response, I wrapped the Client myself in an Arc. Thanks for your feedback :)
Currently the
Storage Client
is notclone
. It also cannot be derived directly becauseServiceAccountClient
is also notclone
Can we derive that on these two structs or does that introduce sideeffects? I would imagine that duplicating theServiceAccountClient
means duplicating the authentication logic. Thoughts @yoshidan?