diff --git a/Cargo.lock b/Cargo.lock
index f33548a..55ed45a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -328,6 +328,15 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "atoi"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "autocfg"
version = "1.1.0"
@@ -2087,7 +2096,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70f7f96eab66f057d0ce7139840edadacc114fbc978d41898550731b473186ad"
dependencies = [
"async-trait",
- "atoi",
+ "atoi 0.3.3",
"backtrace",
"bytes",
"chrono",
@@ -4298,9 +4307,10 @@ dependencies = [
name = "synd-kvsd-protocol"
version = "0.1.0"
dependencies = [
- "atoi",
+ "atoi 2.0.0",
"bytes",
"chrono",
+ "futures",
"thiserror",
"tokio",
]
diff --git a/Cargo.toml b/Cargo.toml
index c01bc89..3e33928 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,6 +29,7 @@ either = { version = "1.13.0" }
fake = { version = "2.10.0", features = ["derive", "chrono"] }
fdlimit = { version = "0.3.0", default-features = false }
feed-rs = { version = "1.5", default-features = false }
+futures = { version = "0.3.30" }
futures-util = { version = "0.3.30", default-features = false }
graphql_client = { version = "0.13.0", default-features = false }
headers = { version = "0.4.0" }
diff --git a/crates/synd_kvsd_protocol/Cargo.toml b/crates/synd_kvsd_protocol/Cargo.toml
index 146b844..361429b 100644
--- a/crates/synd_kvsd_protocol/Cargo.toml
+++ b/crates/synd_kvsd_protocol/Cargo.toml
@@ -14,12 +14,12 @@ name = "synd-kvsd-protocol"
version = "0.1.0"
[dependencies]
-# TODO: use latest
-atoi = { version = "0.3.3" }
+atoi = { version = "2.0.0" }
bytes = { workspace = true }
chrono = { workspace = true }
+futures = { workspace = true }
thiserror = { workspace = true }
-tokio = { workspace = true, features = ["net"] }
+tokio = { workspace = true, features = ["net", "time", "io-util"] }
[lints]
workspace = true
diff --git a/crates/synd_kvsd_protocol/src/connection.rs b/crates/synd_kvsd_protocol/src/connection.rs
index ef1506b..c687394 100644
--- a/crates/synd_kvsd_protocol/src/connection.rs
+++ b/crates/synd_kvsd_protocol/src/connection.rs
@@ -1,9 +1,10 @@
use std::{
- io::{self, Cursor},
+ io::{self},
time::Duration,
};
use bytes::{Buf as _, BytesMut};
+use futures::TryFutureExt as _;
use thiserror::Error;
use tokio::{
io::{AsyncRead, AsyncReadExt as _, AsyncWrite, BufWriter},
@@ -11,7 +12,7 @@ use tokio::{
time::error::Elapsed,
};
-use crate::message::{FrameError, Message, MessageError, MessageFrames};
+use crate::message::{Cursor, FrameError, Message, MessageError, MessageFrames};
#[derive(Error, Debug)]
pub enum ConnectionError {
@@ -72,10 +73,9 @@ where
&mut self,
duration: Duration,
) -> Result