Provide a mechanism to initialize the client fully at start-up time.
Current work-around:
Do any dummy operation forcing the initialization.
What about adding a static create method? This way it prevents people from calling the OpenAsync multiple calls like in v2, and it would be more obvious then having a random method on the client.
c#
CosmosClient client = await CosmosClient.CreateAsync(
string endpoint,
string key,
ClientOptions options);
I like it - but i would prefer a method name like CreateAndInitializeAsync - or CreateAndWarmUpAsync etc.
I agree that would be a better method name. I prefer CreateAndInitializeAsync.
Async CTOR's would have been really awesome!
Thoughts on how to enable API/scenario reviews in open-way. I.e. enable community also participate?
Created #1706 to cover wider scenarios and alternatives, discussion.
Most helpful comment
What about adding a static create method? This way it prevents people from calling the OpenAsync multiple calls like in v2, and it would be more obvious then having a random method on the client.
c# CosmosClient client = await CosmosClient.CreateAsync( string endpoint, string key, ClientOptions options);