Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up the API wrapper #312

Open
wchill opened this issue Aug 15, 2016 · 3 comments
Open

Cleaning up the API wrapper #312

wchill opened this issue Aug 15, 2016 · 3 comments

Comments

@wchill
Copy link
Contributor

wchill commented Aug 15, 2016

Right now I'm not satisfied with how the API wrapper is structured. For context, the way it currently works is the following:

Bot/plugin calls API method => wrapper determines which read-only calls are cached and strips them out => wrapper performs API call => wrapper parses response into objects => wrapper returns all objects.

It's not really a clean solution (just look at the parsing methods and the data objects) and I never really intended it to be one, just as a stopgap to prevent the overuse of dict accesses for API responses.

Any ideas on how this can be improved?

@andythorne
Copy link
Collaborator

andythorne commented Aug 16, 2016

As we discussed on slack yesterday, getting a good understanding about how the app calls the API (orders, frequencies, etc) would be a good first step.

If we move to a queue, then that may solve some of the caching we're having to do (as, to niantic, it would not look like odd activity).

Unfortunately mapping API responses to an object is going to be a semi-manual task, unless our api models will reflect the api exactly (but then we may as well use a dict! (joke)).

@niicojs
Copy link
Contributor

niicojs commented Aug 17, 2016

There should be plenty of guys that already tested this, on reddit, discord, ... @wchill might know a bunch of them.

@niicojs
Copy link
Contributor

niicojs commented Sep 4, 2016

#360 is coming close to that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants