Giter Site home page Giter Site logo

Comments (4)

JiamingFB avatar JiamingFB commented on April 20, 2024

Hi kilink,

Thanks for the suggestion. I agree that it makes more sense to let the http request configuration flow with APIContext, so we may have multiple configs for different users. We'll think about adding the config into APIContext to make it more flexible, while still keeping the current global 'default' config, which is easier to code and covers most of the use cases.

from facebook-java-business-sdk.

kilink avatar kilink commented on April 20, 2024

I would argue that the current global configuration is not easier to code with. As I mentioned, it makes testing more awkward and limited, and it means that my code that my Facebook related code can never really be isolated, since it must set some global state.

Imagine I wanted to call two sets of APIs with different retry policies. Maybe for certain calls, I want to retry several times, but for others it's okay if it fails immediately. With the current approach, I would need to put all of that logic in the request executor itself, since I am not able to set different IRequestExecutor instances for use with different sets of APIs.

I don't think we lose any usability by moving the IRequestExecutor configuration to the context object. All that needs to be done to maintain the current behavior is to just initialize the context with the current default request executor. That will keep the current behavior, and allow consumers to customize and test things more easily.

I can open a PR for this if you think this approach makes sense.

from facebook-java-business-sdk.

stale avatar stale commented on April 20, 2024

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

from facebook-java-business-sdk.

stale avatar stale commented on April 20, 2024

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

from facebook-java-business-sdk.

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.