Drop feature, move to nonblocking mod

This commit is contained in:
Michael Vines
2022-01-26 16:14:49 -08:00
parent a6a8a712e5
commit 8c376f58cb
7 changed files with 15 additions and 13 deletions

View File

@@ -10,8 +10,6 @@ pub mod nonblocking;
pub mod nonce_utils;
pub mod perf_utils;
pub mod pubsub_client;
#[cfg(feature = "async")]
pub mod pubsub_client_async;
pub mod rpc_cache;
pub mod rpc_client;
pub mod rpc_config;

View File

@@ -1 +1,2 @@
pub mod pubsub_client;
pub mod rpc_client;

View File

@@ -48,13 +48,16 @@ pub enum PubsubClientError {
#[error("unable to connect to server")]
ConnectionError(tokio_tungstenite::tungstenite::Error),
#[error("websocket error")]
WsError(#[from] tokio_tungstenite::tungstenite::Error),
#[error("connection closed")]
ConnectionClosed,
#[error("json parse error")]
JsonParseError(#[from] serde_json::error::Error),
#[error("subscribe failed: {reason}")]
SubscribeFailed {
reason: &'static str,
@@ -75,7 +78,7 @@ pub struct PubsubClient {
}
impl PubsubClient {
pub async fn connect(url: &str) -> PubsubClientResult<Self> {
pub async fn new(url: &str) -> PubsubClientResult<Self> {
let url = Url::parse(url)?;
let (ws, _response) = connect_async(url)
.await