Skip to content
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

Added blocking support for posix #50

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eranknafo2001
Copy link

@eranknafo2001 eranknafo2001 commented May 4, 2022

Fixes #12

@mlsvrts mlsvrts mentioned this pull request Jun 30, 2022
@sirhcel
Copy link
Contributor

sirhcel commented Jul 28, 2022

Thank you for this PR! What about some rewording on the proposed interface: As the I/O operations will always be blocking (in the sense of non-blocking I/O) wouldn't be set_timeout(None) more clearly express "no timeout" than set_blocking(true)?

This would be a breaking change. But couldn't a timeout type with an auto-conversion from Duration like

set_blocking<T: Into<Option<Duration>>>(timeout: T) { ... }

buy us out?

And just as a side-note: Shouldn't be no timeout the default instead of 0? This would at least be my expectation as one who grew up on Linux.

@sirhcel
Copy link
Contributor

sirhcel commented Aug 31, 2024

This would be a breaking change. But couldn't a timeout type with an auto-conversion from Duration like

set_blocking<T: Into<Option<Duration>>>(timeout: T) { ... }

buy us out?

Giving it a try at Rust Playground, it looks like it could.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

read is always non-blocking even when no data is available to read
2 participants