Move Eio.Stdenv.t to Eio_unix.Stdenv.base #498
Merged
+59
−97
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 old type wasn't directly useful for anything, since nothing provides exactly this set of resources, and nothing needs to consume exactly this set either. However, it is useful in Eio_unix as the set of resources that a backend needs to provide to be compatible with
Eio_main.run
.The new type is almost the same for now, except that the standard streams include file descriptors. Other Unix-specific features can be added later, such as support for passing file descriptors over sockets or to child processes.
I called the type
base
because we might want to add aStdenv.linux_or_unix
subtype later for basically everything that isn't Windows. Not sure what the name should be, though.Note that, due to the way row-polymorphism works in OCaml, we can't e.g. have
Net.connect
return anEio_unix.socket
subtype ofEio.Net.socket
. But we can add a new function (e.g.connect_unix
) that returns a richer socket type.