These snippets provide a foundation for starting and stopping supervision trees at runtime using feature flags (e.g. Launch Darkly).
Some things to note when adapting these snippets:
- application.ex needs to be adapted into an existing application. The important part is that each child spec provided is compliant, and that there is a feature flag (
- As written, if a feature flag fails for some reason, it defaults to starting all children. There is room for adaptation here as needed.
- This implementation will still require a
FeatureFlagsmodule to be available that implements
is_on?/2. Adjust as needed to accomodate your own feature flag setup.