Closed ysangkok closed 3 years ago
Having the same problem here.
Thanks for the feedback and sharing your workaround.
I haven't done any async work in Rust yet so it's more likely I'm missing something than you. The library is really just a glorified library of structs so maybe it has something to do with using the blocking version of Reqwest?
I like your idea of having the option to execute your own HTTP GET request and sending back the results. I'm not a big fan of having Reqwest as a dependency.
It might be a week or two before I can look at this more closely.
FYI I've encountered the same issue when using blocking Reqwest client, independently of google_maps. Might be an issue in Reqwest or tokio, which I intend to minimize and report.
I had this issue before, and had created an async fork of this project for my own use here. You may take reference from the approach.
@headuck do you have any plans to update it for tokio 1?
@Mause My fork is being used in a 0.2 environment with other crates which also depends on 0.2. Perhaps need to wait a little bit when the dependencies are updated.
@headuck no worries, I wound up using the compatibility crate and it worked with no issues
I am using this library from an async context, and it seems to break with the message:
I have worked around it using an additional thread to wrap the google_maps usage.
But really, shouldn't the library be modified to be able to be used in a context with an existing runtime?
I was thinking, maybe it would be possible to provide either an async API? Alternatively, google_maps could simply return a reqwest::RequestBuilder and let me execute the request with my own reqwest::Client, then I could pass the response back into this library.
Or maybe there is some other obvious solution I am missing?
Thanks for your efforts, it works fine so far!