open-feature / spec

OpenFeature specification
https://openfeature.dev
Apache License 2.0
612 stars 35 forks source link

Unable to cleanly dispose of a provider instance #99

Closed weyert closed 1 year ago

weyert commented 2 years ago

The specification doesn't appear to define a way to cleanly dispose of provider instances. Some provider implementations which uses SDKs of the vendor and these SDKs might have event listeners, create watchers, or timers. These should be need to be cleanly disposed off when the client is being dismissed.

I think it would be useful to add a async shutdown-function to the client to allow shutting down and stop any potential leaky objects

justinabrahms commented 2 years ago

This should trigger when the api object dies as well as if we swap out the provider.

toddbaert commented 2 years ago

:100: , couldn't agree more. This is related to https://github.com/open-feature/spec/issues/77.

This will become very important when we expose events on the OpenFeature client API. This is a major new feature for us, we decided we didn't need it for the first alpha, but we will need it soon :tm: , especially for client-side SDKs.

I'm not sure we should do this BEFORE we work on events, though.

toddbaert commented 1 year ago

I'd like to see an OFEP for this at some point, but it's not pressing. I'm leaving this open for now.

beeme1mr commented 1 year ago

Closing in favor of the OFEP.