Skip to content

jsonrpc: Add async support#558

Open
jamillambert wants to merge 4 commits intorust-bitcoin:masterfrom
jamillambert:0417-jsonrpc-async
Open

jsonrpc: Add async support#558
jamillambert wants to merge 4 commits intorust-bitcoin:masterfrom
jamillambert:0417-jsonrpc-async

Conversation

@jamillambert
Copy link
Copy Markdown
Collaborator

Pulled out of #505 and polished.

The aim is to add async support without breaking existing sync downstream. This includes keeping the reexports of the current sync Client at the crate root.

Code copy only to make it easier in the next patch to see what the
changes are for async.
Remove code related to fuzzing from the new async files. Fuzzing of the
async client can be added back later if needed.
In preparation for adding another async client change the Debug impl to
refer to the local sync Client so that there is no conflict when adding
the second async Client struct.
Copy link
Copy Markdown
Contributor

@satsfy satsfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 5906ce1 - Ran some async tests locally with the new client.


impl BitreqHttpTransport {
/// Constructs a new [`BitreqHttpTransport`] with default parameters.
pub fn new() -> Self { BitreqHttpTransport::default() }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment. Should we consider some validation here? So that the user cannot shoot themselves on the foot like:

use jsonrpc::bitreq_http_async::Builder;
Builder::new().url("not_a_url").is_ok();

I suppose a validation could happen at new or at fn build(self). No change required, because sync client also does it too. But it's a thought for production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants