Netflix / archaius

Library for configuration management API
Apache License 2.0
2.46k stars 485 forks source link

Lambdas for proxies take2 #686

Open rgallardo-netflix opened 11 months ago

rgallardo-netflix commented 11 months ago

This PR re-introduces the usage of lambdas for config proxies. I refactored things into a separate class and split the implementations for different JVMs to make things cleaner. I also introduced a "usage counter" circuit breaker to reduce the chance that users could hit OOM errors like they did before. I'll probably end up removing that later, thought.

There's also a bunch of compiler warning cleanups. I tried to keep those on a separate commit so the actual change is easier to review.

rgallardo-netflix commented 11 months ago

I've also realized that, since a ConfigProxyFactory is always initialized after the config object it proxies ... we could have a flag to disable use of lambdas! So anyone hit by the weirdness can just set the flag and keep on leaking proxies to their hearts contents 😁