Skip to content
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

Async initialization of a client #133

Open
verdie-g opened this issue Sep 12, 2024 · 1 comment
Open

Async initialization of a client #133

verdie-g opened this issue Sep 12, 2024 · 1 comment

Comments

@verdie-g
Copy link
Contributor

verdie-g commented Sep 12, 2024

In some cases, a client is lazily initialized when we need, making the initialization in the hot path of a request. It would be great in that case no threads were blocked to avoid impacting the throughput of the thread pool.

Could we have an API like this one

AsyncClient client = new(/* ... */);
await client.StartAsync();

or safer

AsyncClient client = await AsyncClient.CreateAsync(/* ... */)
@shannonklaus
Copy link
Collaborator

Yes, we can have an API like this in the async awaitable client. Thanks for bringing this to my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants