This is an automated email from the ASF dual-hosted git repository.
bashirbekov pushed a commit to branch draft-sans
in repository https://gitbox.apache.org/repos/asf/iggy.git
The following commit(s) were added to refs/heads/draft-sans by this push:
new 052293f7 test
052293f7 is described below
commit 052293f7e79ce3b999d586c28bb1db0603ebd1f0
Author: haze518 <[email protected]>
AuthorDate: Sun Jul 13 20:52:32 2025 +0600
test
---
.../benchmark_producing_consumer.rs | 5 +++++
core/integration/src/tcp_client.rs | 24 +++++++++++++++-------
core/sdk/src/driver/tcp.rs | 11 ----------
core/sdk/src/lib.rs | 1 -
core/sdk/src/transport_factory/mod.rs | 5 -----
5 files changed, 22 insertions(+), 24 deletions(-)
diff --git
a/core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs
b/core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs
index bc102ffd..26efdd98 100644
--- a/core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs
+++ b/core/bench/src/actors/producing_consumer/benchmark_producing_consumer.rs
@@ -29,7 +29,12 @@ use bench_report::benchmark_kind::BenchmarkKind;
use bench_report::individual_metrics::BenchmarkIndividualMetrics;
use bench_report::numeric_parameter::BenchmarkNumericParameter;
use human_repr::HumanCount;
+use iggy::connection::tcp::tcp::TokioTcpFactory;
+use iggy::driver::tcp::TokioTcpDriver;
use iggy::prelude::*;
+use iggy::proto::connection::{IggyCore, IggyCoreConfig};
+use iggy::proto::runtime::{sync, TokioRuntime};
+use iggy::transport_adapter::r#async::AsyncTransportAdapter;
use integration::test_server::{ClientFactory, login_root};
use std::sync::Arc;
use std::time::Duration;
diff --git a/core/integration/src/tcp_client.rs
b/core/integration/src/tcp_client.rs
index a5a4ae04..4a5f5491 100644
--- a/core/integration/src/tcp_client.rs
+++ b/core/integration/src/tcp_client.rs
@@ -18,7 +18,7 @@
use crate::test_server::{ClientFactory, Transport};
use async_trait::async_trait;
-use iggy::prelude::{Client, TcpClient, TcpClientConfig};
+use iggy::{connection::tcp::tcp::TokioTcpFactory, driver::tcp::TokioTcpDriver,
prelude::{Client, IggyClient, TcpClient, TcpClientConfig},
proto::{connection::{IggyCore, IggyCoreConfig}, runtime::{sync, TokioRuntime}},
transport_adapter::r#async::AsyncTransportAdapter};
use std::sync::Arc;
#[derive(Debug, Clone, Default)]
@@ -35,12 +35,22 @@ impl ClientFactory for TcpClientFactory {
nodelay: self.nodelay,
..TcpClientConfig::default()
};
- let client = TcpClient::create(Arc::new(config)).unwrap_or_else(|e| {
- panic!(
- "Failed to create TcpClient, iggy-server has address {},
error: {:?}",
- self.server_addr, e
- )
- });
+
+ let tcp_factory = Arc::new(TokioTcpFactory::create(Arc::new(config)));
+ let core =
Arc::new(sync::Mutex::new(IggyCore::new(IggyCoreConfig::default())));
+ let rt = Arc::new(TokioRuntime{});
+ let notify = Arc::new(sync::Notify::new());
+ let dirver = TokioTcpDriver::new(core.clone(), rt.clone(),
notify.clone(), tcp_factory.clone());
+ let adapter = Box::new(AsyncTransportAdapter::new(tcp_factory, rt,
core, dirver, notify));
+
+ let client = IggyClient::create(adapter, None, None);
+
+ // let client = TcpClient::create(Arc::new(config)).unwrap_or_else(|e|
{
+ // panic!(
+ // "Failed to create TcpClient, iggy-server has address {},
error: {:?}",
+ // self.server_addr, e
+ // )
+ // });
Client::connect(&client).await.unwrap_or_else(|e| {
panic!(
"Failed to connect to iggy-server at {}, error: {:?}",
diff --git a/core/sdk/src/driver/tcp.rs b/core/sdk/src/driver/tcp.rs
index a3fac722..0e1eec26 100644
--- a/core/sdk/src/driver/tcp.rs
+++ b/core/sdk/src/driver/tcp.rs
@@ -88,17 +88,6 @@ where
}
};
- // let status = u32::from_le_bytes(
- // rx_buf[..4]
- // .try_into()
- // .map_err(|_|
IggyError::InvalidNumberEncoding).unwrap(),
- // );
- // let length = u32::from_le_bytes(
- // rx_buf[4..]
- // .try_into()
- // .map_err(|_|
IggyError::InvalidNumberEncoding).unwrap(),
- // );
-
let buf = Cursor::new(&rx_buf[..]);
let inbound = {
diff --git a/core/sdk/src/lib.rs b/core/sdk/src/lib.rs
index fd55e016..7f9feaac 100644
--- a/core/sdk/src/lib.rs
+++ b/core/sdk/src/lib.rs
@@ -27,7 +27,6 @@ pub mod quic;
pub mod stream_builder;
pub mod tcp;
pub mod proto;
-pub mod transport_factory;
pub mod connection;
pub mod transport_adapter;
pub mod driver;
diff --git a/core/sdk/src/transport_factory/mod.rs
b/core/sdk/src/transport_factory/mod.rs
deleted file mode 100644
index fc429407..00000000
--- a/core/sdk/src/transport_factory/mod.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-use futures::{AsyncRead, AsyncWrite};
-
-pub trait AsyncStream: AsyncRead + AsyncWrite + Unpin + Send + 'static {}
-impl<T> AsyncStream for T where T: AsyncRead + AsyncWrite + Unpin + Send +
'static {}
-