Code Monkey home page Code Monkey logo

Comments (6)

AlexBalo avatar AlexBalo commented on June 10, 2024

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.

orhanobut avatar orhanobut commented on June 10, 2024

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.

adrienleroy avatar adrienleroy commented on June 10, 2024

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.

orhanobut avatar orhanobut commented on June 10, 2024

@adrienleroy In the next release, we will remove the static declaration.

from wasp.

AlexBalo avatar AlexBalo commented on June 10, 2024

@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.

orhanobut avatar orhanobut commented on June 10, 2024

This is fixed, (v1.5)

from wasp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.