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
| ✅ |[Eventing](#eventing)| React to state changes in the provider or flag management system. |
110
110
| ✅ |[Shutdown](#shutdown)| Gracefully clean up a provider during application shutdown. |
111
111
| ✅ |[Transaction Context Propagation](#transaction-context-propagation)| Set a specific [evaluation context](/docs/reference/concepts/evaluation-context) for a transaction (e.g. an HTTP request or a thread) |
112
+
| ✅ |[Asynchronous Feature Retrieval](#asynchronous-feature-retrieval)| Evaluate flags in an asychronous context. |
112
113
| ✅ |[Extending](#extending)| Extend OpenFeature with custom providers and hooks. |
113
114
114
115
<sub>Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌</sub>
@@ -316,6 +317,26 @@ async def some_endpoint():
316
317
return create_response()
317
318
```
318
319
320
+
### Asynchronous Feature Retrieval
321
+
322
+
The OpenFeature API supports asynchronous calls, enabling non-blocking feature evaluations for improved performance, especially useful in concurrent or latency-sensitive scenarios. If a provider *hasn't* implemented asynchronous calls, the client can still be used asynchronously, but calls will be blocking (synchronous).
323
+
324
+
```python
325
+
import asyncio
326
+
from openfeature import api
327
+
from openfeature.provider.in_memory_provider import InMemoryFlag, InMemoryProvider
flag_value =await client.get_boolean_value_async("v2_enabled", False) # API calls are suffixed by _async
333
+
334
+
print("Value: "+str(flag_value))
335
+
```
336
+
337
+
See the [develop a provider](#develop-a-provider) for how to support asynchronous functionality in providers.
338
+
339
+
319
340
### Shutdown
320
341
321
342
The OpenFeature API provides a shutdown function to perform a cleanup of all registered providers. This should only be called when your application is in the process of shutting down.
0 commit comments