georust / georust/geocoding

Support async requests

Open
#51 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
82
Forks
22
PR merge metrics
No merged PRs in 30d

Description

I recently found this crate and absolutely love it. Thanks for the amazing project and keep up the good work! :+1:

During usage I wonder why the provided functions aren't `async` as the data must be fetched from somewhere. After looking into the code base I found that we currently use blocking requests.

At first it seems like an easy implementation for me, since we just have to migrate the usage of the blocking `reqwest` client to a non blocking and transform some traits and functions to `async`. What maybe could be implemented with a optional feature flag. However, after trying to prototype this on my own fork (https://github.com/jontze/geocoding/tree/feat/async-fetching) I came to the conclusion that it is not that easy :laughing: . Since it looks like that there have to be done some refactor of at least the `Point` struct in the [geo-types](https://github.com/georust/geo/tree/master/geo-types) crate to support rust futures.

Furthermore, a feature flag is definitely not the cleanest solution to implement this since it will lead to some code duplication, I guess. On the other side transforming the whole crate to async will be a major breaking change for the user...

However, before continuing on that, are there any plans for the future to support async data fetching instead of blocking?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.