Comments (6)
I think it would be great to have just one service and make it as much dynamic as possible. Probably we can consider adding the trusting certificate logic using annotations. What do you think?
When do you think having more than one service can make sense apart from this certificate example you pointed out?
from wasp.
I think there is no harm to make it non-static, that's totally valid and RequestQueue is not so expensive in the terms of cost. I'm also wondering why we added static there at the first place. Need to check though, but so far seems there is no advantage of having static.
But as @AlexBalo said, we really want to stick just one interface to handle everything and make things easier. That's why we introduced annotation solutions to avoid having 2 different services. At least so far, we managed to not needing the second one.
Apart from that, with wasp, different endpoint can be added to specific request calls. If we provide a certificate for that as well, there will be no need to another service.
By looking the code, I think we also need to consider check the context and use the only applicationContext(), if the context comes from the activity, we would have a strong reference and prevent GC apparently.
And for the getting requestQueue, we should also consider synchronization.
from wasp.
Let say that i have 100 request to make, 50 on api A and 50 on api B, i should annotate 50 time the method for api B !
And for exemple for api if both api A and B need Authorization, how do you manage different RequestInterceptor per apis?
In my mind, as soon i have to connect to different apis i should have a different service.
from wasp.
@adrienleroy In the next release, we will remove the static declaration.
from wasp.
@adrienleroy yes, sure I agree with what you said. Logically makes more sense to have different services if you are connecting to different apis for example.
from wasp.
This is fixed, (v1.5)
from wasp.
Related Issues (20)
- use rxjava occur IllegalArgumentException "Callback should be added as param" HOT 1
- Custom executor should be available
- Custom volley request queue should be injected HOT 1
- Crash when getting annotations. HOT 5
- [question] when using Observables how can I fetch statusCode HOT 2
- how to parse an array without root HOT 5
- How to test Android UI using IdlingResource(Espresso) when using Wasp network requests HOT 1
- How does RetryPolicy work? HOT 1
- Problem with post body with byte[], body changed! HOT 4
- Volley appears to ignore timeout settings. HOT 1
- How to add multiple params on interceptors onQueryParamsAdded (solved) HOT 1
- Consider moving to official Volley library HOT 1
- Error 0, what does exactly mean? HOT 5
- How to catch Exception onError method HOT 4
- Dynamic endpoint HOT 4
- Is it possible to not url encode a url parameter somehow? HOT 2
- How to get statusCode from try/catch on sync request
- Attribute Error: BamScanner has no attribute 'indel_table'.
- Null characters (\u0000) in strings? HOT 1
- Leaking connections?
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 wasp.