Skip to content

New strongly typed provider constructor#26

Open
finneg23 wants to merge 1 commit intosplitio:developmentfrom
finneg23:providerOptionsConstructor
Open

New strongly typed provider constructor#26
finneg23 wants to merge 1 commit intosplitio:developmentfrom
finneg23:providerOptionsConstructor

Conversation

@finneg23
Copy link

This change adds in a clearer option for constructing a Provider that offers better visibility into initializing the SDK while mostly just facading for the original implementation.

@sanzmauro
Copy link
Contributor

Hi @finneg23,

Thanks for your suggestions. While reviewing your PR, I noticed that the provider wasn’t following the same pattern we implemented in the others, so I took advantage of that along with your feedback and released a new version of the provider (2.1.0) .
This version allows you to inject the client via the constructor, giving you the flexibility to apply custom configurations or adjust the block-until-ready timeout if needed.

Example of how to use it:

var config = new ConfigurationOptions();
var splitClient = new SplitFactory("YOUR_API_KEY", config).Client();

try
{
    splitClient.BlockUntilReady(10000); // wait up to 10 seconds for SDK to be ready
}
catch (Exception ex)
{
    // log & handle
}

await Api.Instance.SetProviderAsync(new Provider(splitClient));

if that works for you, give it a try and let me know your feedback - we can close the PR whenever you feel it's appropriate.

Best regards,
Mauro

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

Successfully merging this pull request may close these issues.

2 participants