fmt+clippy
This commit is contained in:
parent
7f6ee491b2
commit
7c0ac0177e
|
@ -1,4 +1,3 @@
|
|||
use futures::Stream;
|
||||
use log::{info, warn};
|
||||
use solana_sdk::clock::Slot;
|
||||
use solana_sdk::commitment_config::CommitmentConfig;
|
||||
|
@ -22,10 +21,10 @@ use tokio::sync::mpsc::Receiver;
|
|||
use yellowstone_grpc_proto::geyser::SubscribeUpdateBlock;
|
||||
|
||||
use geyser_grpc_connector::grpc_subscription_autoreconnect_tasks::{
|
||||
create_geyser_autoconnection_task, create_geyser_autoconnection_task_with_mpsc,
|
||||
create_geyser_autoconnection_task_with_mpsc,
|
||||
};
|
||||
use geyser_grpc_connector::grpcmultiplex_fastestwins::{
|
||||
create_multiplexed_stream, FromYellowstoneExtractor,
|
||||
FromYellowstoneExtractor,
|
||||
};
|
||||
use geyser_grpc_connector::{GeyserFilter, GrpcConnectionTimeouts, GrpcSourceConfig, Message};
|
||||
use tokio::time::{sleep, Duration};
|
||||
|
|
|
@ -5,7 +5,7 @@ use log::{debug, info, log, trace, warn, Level};
|
|||
use std::time::Duration;
|
||||
use tokio::task::JoinHandle;
|
||||
use tokio::time::{sleep, timeout};
|
||||
use yellowstone_grpc_client::{GeyserGrpcClient, GeyserGrpcClientResult};
|
||||
use yellowstone_grpc_client::{GeyserGrpcClientResult};
|
||||
use yellowstone_grpc_proto::geyser::{SubscribeRequest, SubscribeUpdate};
|
||||
use yellowstone_grpc_proto::tonic::Status;
|
||||
|
||||
|
|
|
@ -11,23 +11,6 @@ use yellowstone_grpc_proto::tonic::service::Interceptor;
|
|||
use yellowstone_grpc_proto::tonic::transport::ClientTlsConfig;
|
||||
|
||||
|
||||
pub async fn connect_with_timeout<E, T>(
|
||||
endpoint: E,
|
||||
x_token: Option<T>,
|
||||
tls_config: Option<ClientTlsConfig>,
|
||||
connect_timeout: Option<Duration>,
|
||||
request_timeout: Option<Duration>,
|
||||
connect_lazy: bool,
|
||||
) -> GeyserGrpcClientResult<GeyserGrpcClient<impl Interceptor>>
|
||||
where
|
||||
E: Into<Bytes>,
|
||||
T: TryInto<AsciiMetadataValue, Error = InvalidMetadataValue>,
|
||||
{
|
||||
GeyserGrpcClient::connect_with_timeout(
|
||||
endpoint, x_token, tls_config, connect_timeout, request_timeout, connect_lazy).await
|
||||
}
|
||||
|
||||
|
||||
// see https://github.com/hyperium/tonic/blob/v0.10.2/tonic/src/transport/channel/mod.rs
|
||||
const DEFAULT_BUFFER_SIZE: usize = 1024;
|
||||
// see https://github.com/hyperium/hyper/blob/v0.14.28/src/proto/h2/client.rs#L45
|
||||
|
@ -104,7 +87,7 @@ pub async fn connect_with_timeout_with_buffers<E, T>(
|
|||
let interceptor = InterceptorXToken { x_token };
|
||||
|
||||
let channel = endpoint.connect_lazy();
|
||||
let mut client = GeyserGrpcClient::new(
|
||||
let client = GeyserGrpcClient::new(
|
||||
HealthClient::with_interceptor(channel.clone(), interceptor.clone()),
|
||||
GeyserClient::with_interceptor(channel, interceptor)
|
||||
.max_decoding_message_size(GeyserGrpcClient::max_decoding_message_size()),
|
||||
|
|
Loading…
Reference in New Issue