ETA (estimated time of arrival) caching service for Wheely.
- Calculate dst and src GeoHashes with chosen decimal precision (5).
- Look Redis for desired GeoHashes. Return associated ETA value if exists, end.
- Ask external service for ETA. Return it and save it to Redis.
- Install MongoDB.
- Install Redis.
- Do
bundle
. - Create DB indices
bundle exec rake db:create_indexes
- Test it
bundle exec rake test
- Run
bundle exec ruby app.rb
- Create or update cars with
/car?_id=1&lat=55.7516&long=37.6185&available=true
- Call ETA with
/eta?lat=55.7000&long=37.6236