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

Async support #6

Open
eyeseast opened this issue Sep 21, 2020 · 2 comments
Open

Async support #6

eyeseast opened this issue Sep 21, 2020 · 2 comments

Comments

@eyeseast
Copy link
Owner

Geopy has a set of tools to help with async here: https://geopy.readthedocs.io/en/latest/#async-mode

Should definitely use those, especially when thinking about Datasette integration.

@eyeseast
Copy link
Owner Author

What does this look like in code?

Geopy strongly recommends using a context manager for async calls. And geocode_row right now requires a geocoder function (because of rate limiting). There's a lot to manage here.

Rate limiting example here: https://geopy.readthedocs.io/en/latest/#geopy.extra.rate_limiter.AsyncRateLimiter

It's very possible I'll need to collect all the arguments for everything up front, and then sort everything out. That's messy.

@eyeseast
Copy link
Owner Author

Thinking about this more, especially after spending more time with faster services like OpenCage, Google and Mapbox, I should probably decide whether this is a sync or async library overall. Being in both places is probably too much to manage.

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

No branches or pull requests

1 participant