Comments (9)
Another option would be to give the user the option to provide their own HTTP implementation, which would make this crate runtime-agnostic.
from unleash-client-rust.
My current opinion is that a good approach here would be to make the http
field in Client
generic and bounded by a trait UnleashApi
. This crate then could keep exposing the surf
-based implementation of the trait (that is enabled based on a cargo feature).
At first, I though that a simple switch of implementation based on feature would suffice, but users may have special needs that the default implementation wouldn't support (e.g. at our codebase, we only use rustls for TLS, we don't have openssl as transitive dependency). However, having a trait that the user can fully implement give them more flexibility (a specific user-case that came in my mind now are temporary authorization tokens when implementing custom authorization, which right now would require re-creating the client when the token changes).
from unleash-client-rust.
Thanks @luisholanda. I'll bring this up with the team today, will get back to you shortly.
from unleash-client-rust.
Github Issue: Rust client dependencies
from unleash-client-rust.
Hi @luisholanda, thanks for the inputs here. I can very much see how pulling in a ton of dependencies that you neither want nor need is problematic. I like the suggestion you make about allowing the possibility to provide a custom HTTP client implementation, it sounds like between that and gating the async runtime that would solve your problems while making minimal adjustments to the way the sdk works at the moment. If you'd be willing to do a spike on this, I would love to take a look! Would also be great to @rbtcollins inputs on this too
from unleash-client-rust.
I think bring your own would be a bit enthusiastic right off the bat, let's treat that as a separate feature.
I have no issue just migrating to tokio, surf was arbitrary... as long as what we move too has no hard dependency on the runtime (since that would make us unusable for async-std or smol). Surf today has that property of no runtime dependency.
If there are no such clients in the Tokio ecosystem, then yes, features for each and surf as default.
from unleash-client-rust.
I have no issue just migrating to tokio, surf was arbitrary... as long as what we move too has no hard dependency on the runtime
Ok! I'll do some experiments today to see if I find something that we can use without having to create a bunch of features.
If you'd be willing to do a spike on this, I would love to take a look!
I'll see if I can do a prototype later this week.
from unleash-client-rust.
I didn't find a HTTP implementation that would solve the dependencies problem for all runtimes, so I decided to go with implementing separated features in #31.
Testing the changes in our codebase with the reqwest-client-rustls
feature, only 7 new transitive dependencies were added, all making sense.
from unleash-client-rust.
This should be resolved for you, in main at least.
from unleash-client-rust.
Related Issues (14)
- Performance with unknown features HOT 1
- RUSTSEC-2020-0057: crate has been renamed to `cipher` HOT 1
- RUSTSEC-2020-0056: stdweb is unmaintained HOT 1
- Build of `0.4.0` failed HOT 2
- Enh: remove the Arc<> on each strategy
- Implement Custom Stickiness for Variants
- Make poll_for_updates Send HOT 2
- More informative warn logs HOT 2
- Client should handle 502 errors HOT 5
- Implement Global Segments HOT 1
- custom strategies that aren't configured into the client are hard to debug HOT 1
- poll_for_updates discussion HOT 5
- enh: use enum_dispatch HOT 1
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-rust.