open-feature / open-feature/swift-sdk
Add Shutdown
- Dominant language
- Swift
- Stars
- 31
- Forks
- 14
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 2
Description
Gracefully clean up providers during application shutdown.
**Specification References:**
- [1.6.1](https://openfeature.dev/specification/sections/flag-evaluation#requirement-161): The API MUST define a shutdown function.
- [1.6.2](https://openfeature.dev/specification/sections/flag-evaluation#requirement-162): The shutdown function MUST call the respective shutdown function on the active provider.
- [2.5.1](https://openfeature.dev/specification/sections/providers#requirement-251): The provider MAY define a shutdown function.
- [2.5.2](https://openfeature.dev/specification/sections/providers#requirement-252): After shutdown, the provider SHOULD revert to its uninitialized state.
**Implementation Notes:**
- Add `shutdown()` and `shutdownAndWait()` methods to `OpenFeatureAPI`
- Add optional `shutdown()` method to `FeatureProvider` protocol
- Shutdown must be called when providers are replaced (1.1.2.3)
- Important for flushing tracking data and closing connections
Contributor guide
Assessment
This issue has not been assessed yet.