You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an SDK follows the static-context paradigm, an update to context may lead to an expensive async operation. For that reason, it's recommended to set known context prior to setting the provider. If the context is set later, even immediately after initialization registration, another call to async call may be made.
Set context before set provider
In this scenario, one call is made to the provider during initilzation.
The proposal would ensure that context is available to the provider during initialization. Context can still be updated using OpenFeature.setContext() if necessary, but this would help users avoid unnecessary delays during start up.
Requirements
Define the requirements for setting context during provider registration when using the static-context paradigm
## This PR
- overloads the set provider methods to support defining context in the
web SDK
- updates the web sdk readme
## Related Issues
Fixes#748
## Notes
I decided to only support setting context in the web SDK because it is
less valuable on the server and the expected behavior was less clear due
to `domains`.
The behavior may need to be spec'd out. An issue in the spec repo has
been created.
open-feature/spec#219
---------
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Overview
When an SDK follows the static-context paradigm, an update to context may lead to an expensive async operation. For that reason, it's recommended to set known context prior to setting the provider. If the context is set later, even immediately after initialization registration, another call to async call may be made.
Set context before set provider
In this scenario, one call is made to the provider during initilzation.
Set context after set provider
In this scenario, two calls may be made to the provider because the context changes after initialization.
Proposal
The proposal would ensure that context is available to the provider during initialization. Context can still be updated using
OpenFeature.setContext()
if necessary, but this would help users avoid unnecessary delays during start up.Requirements
Dependencies
References
The text was updated successfully, but these errors were encountered: