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
{{ message }}
Repository navigation
Commit 75e0e75
Browse filesBrowse the repository at this point in the historyBrowse files
| ✅ |[InMemoryProvider](#inmemoryprovider)| Resolve flags from an in-memory configuration, for demos and testing. |
124
124
| ✅ |[Eventing](#eventing)| React to state changes in the provider or flag management system. |
125
-
|❌|[Shutdown](#shutdown)| Gracefully clean up a provider during application shutdown. |
125
+
|✅|[Shutdown](#shutdown)| Gracefully clean up a provider during application shutdown. |
126
126
| ✅ |[Extending](#extending)| Extend OpenFeature with custom providers and hooks. |
127
127
128
128
<sub>Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌</sub>
@@ -445,7 +445,15 @@ let cancellable = OpenFeatureAPI.shared.observe().sink { event in
445
445
446
446
### Shutdown
447
447
448
-
A shutdown function is not yet available in the iOS SDK.
448
+
`OpenFeatureAPI.shared.shutdown()` calls the active provider's `shutdown` and resets the API — provider, hooks and evaluation context — so it can be configured again later; the logger is kept.
449
+
Use `shutdownAndWait()` when you need to know the provider has finished, for example to flush tracking data before the process exits:
450
+
451
+
```swift
452
+
await OpenFeatureAPI.shared.shutdownAndWait()
453
+
```
454
+
455
+
Providers are also shut down whenever they stop being used: `setProvider` shuts down the provider it replaces, and `clearProvider` shuts down the one it removes (`clearProviderAndWait` returns once that is done).
456
+
A provider that holds resources implements `shutdown() -> Future<Void, Never>` to release them and revert to `.notReady` — `ProviderStatusTracker.reset()` does the latter — and resolves the `Future` when it is done; providers with nothing to release inherit a no-op default.
0 commit comments