Add .set_blocking to Socket and IO::FileDescriptor and deprecate #blocking property#16033
Merged
straight-shoota merged 6 commits intocrystal-lang:masterfrom Aug 2, 2025
Conversation
…escriptor#blocking[=]`
Co-authored-by: Johannes Müller <straightshoota@gmail.com>
Collaborator
Author
|
I added the |
straight-shoota
approved these changes
Jul 31, 2025
ysbaddaden
added a commit
to ysbaddaden/crystal
that referenced
this pull request
Sep 2, 2025
straight-shoota
pushed a commit
that referenced
this pull request
Sep 3, 2025
Fijxu
added a commit
to Fijxu/invidious
that referenced
this pull request
Nov 18, 2025
This replaces the deprecated argument `blocking` and uses `Socket.set_blocking(fd, value)` instead. Fixes a warning in the compiler crystal-lang/crystal#16033
unixfox
pushed a commit
to Fijxu/invidious
that referenced
this pull request
Dec 19, 2025
This replaces the deprecated argument `blocking` and uses `Socket.set_blocking(fd, value)` instead. Fixes a warning in the compiler crystal-lang/crystal#16033
unixfox
added a commit
to iv-org/invidious
that referenced
this pull request
Dec 19, 2025
* Replace deprecated `blocking` property of `Socket` This replaces the deprecated argument `blocking` and uses `Socket.set_blocking(fd, value)` instead. Fixes a warning in the compiler crystal-lang/crystal#16033 * Upgrade to upstream * chore: only Socket.set_blocking for > 1.18 --------- Co-authored-by: Emilien <4016501+unixfox@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
#blockingproperties onSocketandIO::FileDescriptorchanges the underlying configuration of the system file descriptor or handle, and can conflict with the IO runtime (i.e. the event loop requirements) and lead to runtime issues.This PR deprecates the
#blockingproperty and instead introduces a couple class methods to change the blocking configuration of a raw file descriptor or handle outside of the IO objects when you really need to change it:IO::FileDescriptor.set_blocking(fd, value)that's only available on UNIX targets (raises on Windows);Socket.set_blocking(fd, value)that's available on all targets (though it's legacy on Windows).Extracted from #15924.