-
Notifications
You must be signed in to change notification settings - Fork 1
chore: v4 - android21 compatible mega PR #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: v4 - android21 compatible mega PR #112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way to puzzle through this! 💪 💪 💪
I imagine for the upstream clients we could still present the completable future interface if desired by wrapping the callbacks. Also Lambdas may be ok with "desugaring".
private final CallbackManager<Configuration, Configuration.ConfigurationCallback> | ||
configChangeManager = | ||
new CallbackManager<>( | ||
// no lambdas before java8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they android 21 compatible through its "desugaring"? Would that be ok to support or, do we need stay away from that entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The handy thing is that for the dev, if they're using a platform that supports lambdas, they can use a lambda when they register a callback (this is in EppoClient
). Since the callback interface there is a once function interface, Java will treat it interchangeably with a lambda whose signature matches the function.
Simplified callback interface Renamed methods to match "gen2" sdk naming Added activateConfiguration method expose isGracefulMode to subclasses moved graceful mode check top-level callsites (in poller and in assignment calls) renamed callbacks clarified init in tests
* chore: replace use of string.join for android 21 (#111) * extract base64 codec for portation
* chore: refactor out JSON parsing
Eppo Internal:
🎟️ Fixes FF-4351
Motivation and Context
In order to support Android API level 21, we need to remove some of the more modern features previously integrated. One such construct is the
CompletableFuture
, java's version of thePromise
. In order to be compatible all the way back to java6, we need to replace these async structures with Callbacks for better or worse (and we can't even use lambdas)Description
CallbackManager
class to use a dispatcher that gets around using different callback structures with a callback manager (needed only because we can't use lambdas)CompletableFuture
s, plumb callbacks everywhere for asyncBreaking Changes
protected void loadConfigurationAsync(EppoActionCallback<Configuration> callback)
public void saveConfiguration(@NotNull final Configuration configuration)
apiKey
tosdkKey
expectObfuscated
parameterhost
parameterNew API
activateConfiguration
How has this been documented?
How has this been tested?