-
Notifications
You must be signed in to change notification settings - Fork 22
Description
I recently found this crate and absolutely love it. Thanks for the amazing project and keep up the good work! 👍
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 😆 . Since it looks like that there have to be done some refactor of at least the Point struct in the 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?