-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
io: add tokio_util::io::simplex
#7565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
ee6ae5a
to
c8a39fb
Compare
Signed-off-by: ADD-SP <[email protected]>
c8a39fb
to
43805ab
Compare
@@ -27,7 +27,7 @@ net = ["tokio/net"] | |||
compat = ["futures-io"] | |||
codec = [] | |||
time = ["tokio/time", "slab"] | |||
io = [] | |||
io = ["tokio/rt"] |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
fn with_capacity(backpressure_boundary: usize) -> Self { | ||
Self { | ||
backpressure_boundary, | ||
is_closed: false, | ||
receiver_waker: None, | ||
sender_waker: None, | ||
buf: BytesMut::new(), |
There was a problem hiding this comment.
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.
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