-
Notifications
You must be signed in to change notification settings - Fork 16
Add an example tcp_echo_server_non_blocking
#32
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
Conversation
|
Thanks for submitting this. We will want to exercise this with a test like we do for the tcp_echo_server. As far as the style, this uses |
Done. It does need a test, but due to bytecodealliance/wasmtime#9667, I haven’t found a good way to write one yet. |
|
|
||
| futures_lite::future::poll_fn(|cx| { | ||
| if let Poll::Ready(_) = listening_task.as_mut().poll(cx) { | ||
| return Poll::Ready(()); |
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 don't think we want to return as Ready until both the Listener is ready and the stream tasks are all complete.
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.
Sorry, I didn't quite understand what you meant. Could you please tell me your thoughts directly?
|
With #86, this example has been changed to use tasks, and so it no longer has the blocking behavior. |
|
Cool! |
#25