Comments (5)
If this is changed, I'd highly prefer an API that can compile-time checked.
As in, don't expose the current constructor, but have something like public static Unleash startPolling()
in a UnleashBuilder
or something like that. If that's not wanted, an IllegalStateException
has to be thrown, defaulting to some other state is way more surprising and error-prone IMO.
Not sure if this is really needed though.
The way unleash is implemented now it is not really intuitive for the developer.
How so?
We see from time to time this ending up with memory leakage because the developer creates a new unleash instance per request handler.
Could all the clients use a static poller and metrics publisher so they all share that one instance instead? So you can instantiate multiple UnleashClient
s without worry
from unleash-client-java.
Could all the clients use a static poller and metrics publisher so they all share that one instance instead?
Unleash already uses just one static poller shared among all instances of unleash. This does not solve the memory leakage problem though, as they all register a callback.
The way unleash is implemented now it is not really intuitive for the developer.
It seems like developers does not realise that Unleash is a service, which will be running in the background, even after the thread creating it is terminated. Maybe we can do some magic around the initiating thread being terminated? Or unleash could detect if it is being instantiated thousands of times and give some kind of warning?
If this is changed, I'd highly prefer an API that can compile-time checked.
Yes, I agree, some kind of builder/factory is the way to go! But I still feel a bit reluctant to changing the API of Unleash. It will be confusing for people upgrading the client if they suddenly have to call a builder/factory.
from unleash-client-java.
The goal should be to make it harder/impossible to do the wrong thing without making it verbose to do the right thing.
Talked some offline with @theneva, any objection against using WeakReference
?
from unleash-client-java.
Would be nice if that just works, have no personal experience using WeakReference in Java.
Care to make a PoC on using it?
from unleash-client-java.
closed via #67
from unleash-client-java.
Related Issues (20)
- Refactor DefaultUnleash to make it customizable with different implementation of IFeatureRepository HOT 1
- Sanitize appName for backupFile HOT 5
- Why use a `BiFunction` when the desired interface was a `BiPredicate`? HOT 1
- Unleash Codegen Gradle Plugin HOT 8
- DefaultUnleash.isEnabled(toggleName, context) silently dropping context HOT 4
- FakeUnleash enable all except certain features HOT 6
- Make Backuphandler extensible HOT 1
- Impression data flag as part of getFeatureToggleDefinition HOT 1
- Client specification header makes server send stale information HOT 12
- SDK exposes Api key in logs
- Missing 8.3.0 release artifact in maven HOT 3
- Strategy check return only the first enabled HOT 3
- Compatability Matrix HOT 2
- Update from 8.3.1 to 9.1.0 changes variant on existing features flags HOT 7
- Remove (again) our deprecated hashing methods
- Filter for tags HOT 2
- Add featureEnabled to variant response HOT 1
- Proxy authentication not working HOT 1
- String operator STR_STARTS_WITH is not evaluated correctly when case-sensative is disabled HOT 6
- FakeUnleash doesn't take into account global activation/deactivation for certain isEnabled method HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unleash-client-java.