Skip to content

Conversation

ADD-SP
Copy link
Member

@ADD-SP ADD-SP commented Aug 31, 2025

Design document

https://gist.github.com/ADD-SP/7558ef3965f18ce1d721dff675d01d9b

Why not deprecate the tokio::io::simplex now?

Since the deprecation is not urgent, we can release this feature and first, and the deprecate the tokio::io::simplex after several months.

issue: #7548

@ADD-SP ADD-SP added C-enhancement Category: A PR with an enhancement or bugfix. A-tokio-util Area: The tokio-util crate M-io Module: tokio/io labels Aug 31, 2025
@ADD-SP ADD-SP force-pushed the add_sp/io-alt-simplex branch 3 times, most recently from ee6ae5a to c8a39fb Compare August 31, 2025 03:45
@ADD-SP ADD-SP force-pushed the add_sp/io-alt-simplex branch from c8a39fb to 43805ab Compare August 31, 2025 04:48
@@ -27,7 +27,7 @@ net = ["tokio/net"]
compat = ["futures-io"]
codec = []
time = ["tokio/time", "slab"]
io = []
io = ["tokio/rt"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm. I'd like to avoid this dependence .... could we have Tokio expose no-op methods without rt?

Poll::Ready(Ok(()))
} else {
inner.register_receiver_waker(cx.waker());
inner.wake_sender();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid calling wake() under a lock.

Comment on lines +35 to +41
fn with_capacity(backpressure_boundary: usize) -> Self {
Self {
backpressure_boundary,
is_closed: false,
receiver_waker: None,
sender_waker: None,
buf: BytesMut::new(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the method is called with_capacity, then it shoud allocate that much memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate C-enhancement Category: A PR with an enhancement or bugfix. M-io Module: tokio/io
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants