-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Prepare IO::FileDescriptor to be platform agnostic #4500
Comments
I was thinking about this too and had envisaged a slightly different design. I was thinking of an |
cc @txe, he might have some feedback on this. |
STDOUT, STDIN and STDERR should use a different async solution on POSIX (blocking calls with timers to interrupt calls) since
Simply have a Windows (FileHandle) vs POSIX (fd) may not be enough... |
Actually, it's quite unclear what problem this additional abstract layer is going to solve. |
Basically the system API boils down to 2 methods: A problem is that windows doesn't use FD for files, so maybe IO::FileDescriptor doesn't make much sense as an abstract class (maybe an includeable module?). |
@ysbaddaden I think @txe is referring to the other platform-specific methods on |
If speak about File, we have the following hierarchy: I thinks, the current |
I think the |
Is the edge-triggered IO option actually useful? I'm thinking of removing it just to simplify IO::FileDescriptor. |
This has been implemented in #5333 |
Current
IO::FileDescriptor
depends on C lib posix functions and has some scheduler related calls.IO::FileDescriptor
is used as a base class forFile
and it is used independently for pipe, process, stdout/err/in.IO::FileDescriptor
could be refactor to be platform agnostic. Probably introducing aCrystal::System::FileHandle
struct to replace the current@fd : Int32
.Along the way
FileHandle
might need to encapsulate calls toScheduler
.#3582 can help as a guide to see which abstractions are needed to later create a
FileHandle
for windows.The text was updated successfully, but these errors were encountered: