Skip to content

Commit 32c80cc

Browse files
committed
Portable delay queue
1 parent aa92ba9 commit 32c80cc

File tree

5 files changed

+642
-19
lines changed

5 files changed

+642
-19
lines changed

quinn/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ rustc-hash = "1.1"
4242
pin-project-lite = "0.2"
4343
proto = { package = "quinn-proto", path = "../quinn-proto", version = "0.9", default-features = false }
4444
rustls = { version = "0.20.3", default-features = false, features = ["quic"], optional = true }
45+
slab = "0.4"
4546
thiserror = "1.0.21"
4647
tracing = "0.1.10"
4748
tokio = { version = "1.13.0", features = ["sync"] }
48-
tokio-util = { version = "0.6.9", features = ["time"] }
4949
udp = { package = "quinn-udp", path = "../quinn-udp", version = "0.3", default-features = false }
5050
webpki = { version = "0.22", default-features = false, optional = true }
5151

@@ -54,6 +54,7 @@ anyhow = "1.0.22"
5454
crc = "3"
5555
bencher = "0.1.5"
5656
directories-next = "2"
57+
proptest = "=1.0.0" # Pinned for MSRV
5758
rand = "0.8"
5859
rcgen = "0.10.0"
5960
rustls-pemfile = "1.0.0"

quinn/src/connection.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ use pin_project_lite::pin_project;
1515
use proto::{ConnectionError, ConnectionHandle, ConnectionStats, Dir, StreamEvent, StreamId};
1616
use rustc_hash::FxHashMap;
1717
use thiserror::Error;
18-
use tokio::{
19-
sync::{futures::Notified, mpsc, oneshot, Notify},
20-
time::Instant as TokioInstant,
21-
};
22-
use tokio_util::time::delay_queue;
18+
use tokio::sync::{futures::Notified, mpsc, oneshot, Notify};
2319
use tracing::debug_span;
2420

2521
use crate::{
22+
delay_queue::Timer,
2623
mutex::Mutex,
2724
recv_stream::RecvStream,
2825
send_stream::{SendStream, WriteError},
@@ -784,8 +781,8 @@ pub(crate) struct State {
784781
on_handshake_data: Option<oneshot::Sender<()>>,
785782
on_connected: Option<oneshot::Sender<bool>>,
786783
connected: bool,
787-
pub(crate) timer_handle: Option<delay_queue::Key>,
788-
pub(crate) timer_deadline: Option<TokioInstant>,
784+
pub(crate) timer_handle: Option<Timer>,
785+
pub(crate) timer_deadline: Option<Instant>,
789786
pub(crate) blocked_writers: FxHashMap<StreamId, Waker>,
790787
pub(crate) blocked_readers: FxHashMap<StreamId, Waker>,
791788
pub(crate) finishing: FxHashMap<StreamId, oneshot::Sender<Option<WriteError>>>,

0 commit comments

Comments
 (0)