mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 14:27:57 +00:00
Introduce RPC Worker (#1462)
* Extract json-rpc-client and introduce worker * Initial rpc worker * Add error handling * Use bounded channels for listeners * Improve naming and clean up * Use tracing channels * Improve code readability * Decrease channel size limit * Remove unused dependency * Fix docs * RPC -> Rpc * Start worker in initialization method * Print error in case a distribution channel is full * Fix docs * Make `RpcStreamWorker` private Co-authored-by: Davide Galassi <davxy@datawok.net> * Use tokio channels and add TODO item * Remove `Option` from `to_worker_channel` Co-authored-by: Davide Galassi <davxy@datawok.net>
This commit is contained in:
@@ -29,7 +29,7 @@ use sc_client_api::StorageProof;
|
||||
use futures::Stream;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use jsonrpsee_core::Error as JsonRPSeeError;
|
||||
use jsonrpsee_core::Error as JsonRpcError;
|
||||
use parity_scale_codec::Error as CodecError;
|
||||
use sp_api::ApiError;
|
||||
use sp_state_machine::StorageValue;
|
||||
@@ -51,9 +51,11 @@ pub enum RelayChainError {
|
||||
#[error("State machine error occured: {0}")]
|
||||
StateMachineError(Box<dyn sp_state_machine::Error>),
|
||||
#[error("Unable to call RPC method '{0}' due to error: {1}")]
|
||||
RPCCallError(String, JsonRPSeeError),
|
||||
RpcCallError(String, JsonRpcError),
|
||||
#[error("RPC Error: '{0}'")]
|
||||
JsonRPCError(#[from] JsonRPSeeError),
|
||||
JsonRpcError(#[from] JsonRpcError),
|
||||
#[error("Unable to reach RpcStreamWorker: {0}")]
|
||||
WorkerCommunicationError(String),
|
||||
#[error("Scale codec deserialization error: {0}")]
|
||||
DeserializationError(CodecError),
|
||||
#[error("Scale codec deserialization error: {0}")]
|
||||
|
||||
Reference in New Issue
Block a user