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

Basic primitives #3

Open
2 tasks
MaeIsBad opened this issue Sep 6, 2022 · 1 comment
Open
2 tasks

Basic primitives #3

MaeIsBad opened this issue Sep 6, 2022 · 1 comment

Comments

@MaeIsBad
Copy link
Collaborator

MaeIsBad commented Sep 6, 2022

  • Files
  • Network sockets
@RileyApeldoorn
Copy link
Owner

These would both require custom abstractions, e.g. file handles and stuff.

Perhaps it's useful to leverage the relevant abstractions in tokio and/or async-std since they have a similar lazy evaluation model. It would have to be a thin wrapper around those types that wraps the produced futures inside IO or wraps an IO inside a future. This would also tie in with the "plan" to make the code more usable with futures etc. The downside is that we'd be tied to a specific executor.

Also, if we do integrate with futures, that would mean that running an IO is probably going to require having an executor at all. This could be put behind a feature flag, though. Setting up the executor etc. can also be done inside IO::run, which would reinforce the "IO::run is the single entry point of your application" pattern, but it also interacts poorly with #[tokio::main] for example.

An alternative approach is to implement sync primitives first and then rewrite them to work with async Rust, possibly behind some feature flag. Thoughts?

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

No branches or pull requests

2 participants