At present, CkbRpcClient is blocking:
|
$struct_name { url, id: 0.into(), client: reqwest::blocking::Client::new(), } |
The docs of reqwest said, tokio::task::spawn_blocking is required.
When use CkbRpcClient in a async code block directly, it causes:
Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.
At present,
CkbRpcClientisblocking:ckb-sdk-rust/src/rpc/mod.rs
Line 51 in c45c4dc
The docs of
reqwestsaid,tokio::task::spawn_blockingis required.When use
CkbRpcClientin a async code block directly, it causes: