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

Add examples/batch.rb script to demo batch geocoding with the async gem #29

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

sbscully
Copy link
Collaborator

@sbscully sbscully commented Nov 8, 2024

  • Add examples directory.
  • Add batch.rb script that demonstrates batch geocoding using async gem.
  • Add async gem to development gem group.

The OpenCage::Geocoder uses open-uri which is a wrapper for Net::HTTP. Net::HTTP works correctly with the async gem, so no library changes are needed.

I benchmarked geocoding 100 items, it took ~55s with one worker and ~5s with 10 workers.

@sbscully sbscully requested a review from mtmail November 8, 2024 15:55
@sbscully sbscully self-assigned this Nov 8, 2024
Ruby 3.0 is end of life and the async gem is not compatible with it.
@mtmail mtmail merged commit e825637 into master Nov 9, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants