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
| ✅ |[Tracking](#tracking)| Associate user actions with feature flag evaluations. |
73
73
| ❌ |[Logging](#logging)| Integrate with popular logging packages. |
74
74
| ❌ |[Named clients](#named-clients)| Utilize multiple providers in a single application. |
75
-
|✅|[Eventing](#eventing)| React to state changes in the provider or flag management system. |
75
+
|❌|[Eventing](#eventing)| React to state changes in the provider or flag management system. |
76
76
| ✅ |[Shutdown](#shutdown)| Gracefully clean up a provider during application shutdown. |
77
77
| ⚠️ |[Extending](#extending)| Extend OpenFeature with custom providers and hooks. |
78
78
@@ -87,10 +87,21 @@ If the provider you're looking for hasn't been created yet, see the [develop a p
87
87
Once you've added a provider as a dependency, it can be registered with OpenFeature like this:
88
88
89
89
```kotlin
90
-
OpenFeatureAPI.setProviderAndWait(MyProvider())
90
+
coroutineScope.launch(Dispatchers.IO) {
91
+
OpenFeatureAPI.setProviderAndWait(MyProvider())
92
+
}
91
93
```
92
94
93
-
> Asynchronous API that doesn't wait is also available
95
+
Asynchronous API that doesn't wait is also available. It's useful when you want to set a provider and continue with other tasks.
96
+
97
+
However, flag evaluations are only possible after the provider is Ready.
98
+
99
+
```kotlin
100
+
OpenFeatureAPI.setProvider(MyProvider()) // can pass a dispatcher here
101
+
// The provider initialization happens on a coroutine launched on the IO dispatcher.
102
+
val status =OpenFeatureAPI.getStatus()
103
+
// When status is Ready, flag evaluations can be made
104
+
```
94
105
95
106
### Targeting
96
107
@@ -160,34 +171,6 @@ Logging customization is not yet available in the Kotlin SDK.
160
171
161
172
Support for named clients is not yet available in the Kotlin SDK.
162
173
163
-
### Eventing
164
-
165
-
Events allow you to react to state changes in the provider or underlying flag management system, such as flag definition changes, provider readiness, or error conditions.
166
-
Initialization events (`PROVIDER_READY` on success, `PROVIDER_ERROR` on failure) are dispatched for every provider.
167
-
Some providers support additional events, such as `PROVIDER_CONFIGURATION_CHANGED`.
168
-
169
-
Please refer to the documentation of the provider you're using to see what events are supported.
0 commit comments