Skip to content

Conversation

jakobbraun
Copy link

Hi,

thanks for your great work creating this library!

With this PR I added an async client for being also able to query RPC methods from async code. I refactored the existing sync client to use the async_client while keeping it's API unchanged. By that there's no duplication but existing users don't have to change their code.

Merging this PR has the following benefits for users of this lib:

  • Async queries are possible
  • The PR replaces the quite old hyper 0.10.15 by version 1.6.0. By that the lib can now be used in projects that use latest hyper.

Thank you in advance for your time to check this PR!

rursprung added a commit to rursprung/xml-rpc-rs that referenced this pull request Apr 3, 2025
`hyper` v0.10 is extremely outdated, the current release is v1.6. this
old version pulls in vulnerable dependencies (incl. `hyper` v0.10
itself).

rather than upgrading to `hyper` v1.6 i opted to replace it with
`reqwest` since this crate here is not `async` and `hyper` v1 is
completely `async`. due to the very limited amount of features needed
from `hyper` (just executing HTTP POST requests) it can instead be
replaced with the much simpler `reqwest` crate. while it hasn't hit v1.0
yet it is very widely used (nearly 200 million downloads on crates.io).

this is a breaking change for consumers since the URLs can now just be
passed as strings rather than having to call `.parse()?` on the string.

note that this is similar to, but not the same as, adnanademovic#8.

fixes adnanademovic#9
@rursprung rursprung mentioned this pull request Apr 3, 2025
@rursprung
Copy link

see #11 where i'm doing something very similar.
i don't think that providing a blocking and async API at the same time is worth it for a small crate like this, so i'd propose that @adnanademovic decides whether he wants to have an async API and if so just completely moves to that instead (see my comment on my PR about that).

@rursprung rursprung mentioned this pull request Apr 3, 2025
rursprung added a commit to rursprung/xml-rpc-rs that referenced this pull request May 15, 2025
`hyper` v0.10 is extremely outdated, the current release is v1.6. this
old version pulls in vulnerable dependencies (incl. `hyper` v0.10
itself).

rather than upgrading to `hyper` v1.6 i opted to replace it with
`reqwest` since this crate here is not `async` and `hyper` v1 is
completely `async`. due to the very limited amount of features needed
from `hyper` (just executing HTTP POST requests) it can instead be
replaced with the much simpler `reqwest` crate. while it hasn't hit v1.0
yet it is very widely used (nearly 200 million downloads on crates.io).

this is a breaking change for consumers since the URLs can now just be
passed as strings rather than having to call `.parse()?` on the string.

note that this is similar to, but not the same as, adnanademovic#8.

fixes adnanademovic#9
rursprung added a commit to rursprung/xml-rpc-rs that referenced this pull request May 29, 2025
`hyper` v0.10 is extremely outdated, the current release is v1.6. this
old version pulls in vulnerable dependencies (incl. `hyper` v0.10
itself).

rather than upgrading to `hyper` v1.6 i opted to replace it with
`ureq` since this crate here is not `async` and `hyper` v1 is completely
`async`. due to the very limited amount of features needed from `hyper`
(just executing HTTP POST requests) it can instead be replaced with the
much simpler `ureq` crate.

i initially opted for `reqwest`, however `reqwest` is primarily `async`
(and uses `hyper` underneath). while it offers a `blocking` layer this
causes major issues when integrating it further up the stack in an
`async` context as also stated by the [`reqwest::blocking` docs].

this is a breaking change for consumers since the URLs can now just be
passed as strings rather than having to call `.parse()?` on the string.

note that this is similar to, but not the same as, adnanademovic#8 and adnanademovic#11.

fixes adnanademovic#9

[`reqwest::blocking` docs]: https://docs.rs/reqwest/latest/reqwest/blocking/
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