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

NonBlockingFileIO has no async APIs #2565

Closed
adam-fowler opened this issue Oct 21, 2023 · 5 comments
Closed

NonBlockingFileIO has no async APIs #2565

adam-fowler opened this issue Oct 21, 2023 · 5 comments

Comments

@adam-fowler
Copy link
Contributor

It appears that the best option for file access is still NonBlockingFileIO. Currently to use NonBlockingFileIO in a Swift concurrency context you are required to use the EventLoop based API and EventLoopFuture.get. This is unsatisfactory because

  1. You need an EventLoop to call any of the functions
  2. Waiting on a process running on the NIOThreadPool requires two hops: one to the EventLoop and then one to your async task.

Are there any plans to produce async NonBlockingFileIO APIs?

@Lukasa
Copy link
Contributor

Lukasa commented Oct 23, 2023

We certainly plan to produce a solution in this area. However, in our ideal world this wouldn't be NIO-based at all, as the solution should be more general purpose than that.

@adam-fowler
Copy link
Contributor Author

Would you be adverse to me producing a temporary solution that still uses NIOThreadPool but skips the EventLoopPromise and uses a Continuation instead?

This is basically the last barrier to removing EventLoops from Soto.

@Lukasa
Copy link
Contributor

Lukasa commented Oct 23, 2023

I'd be happy for you to do that work.

@JawadHF
Copy link

JawadHF commented Oct 23, 2023

We certainly plan to produce a solution in this area. However, in our ideal world this wouldn't be NIO-based at all, as the solution should be more general purpose than that.

Just to understand, would that be something like Swift System ?

@Lukasa
Copy link
Contributor

Lukasa commented Oct 23, 2023

Swift System may be a little too low-level for that.

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

3 participants