Files
swift-nio/Sources
Adam FowlerandGeorge Barnett e69354f123 Async apis for NonBlockingFileIO (#2576)
* Async versions of NonBlockingFileIO functions

I have not produced async versions of the readChunked functions. These
would likely be replaced with an AsyncSequence though.

* Add tests for async versions of NonBlockingFileIO

* Add wrapper for FileRegion to avoid Sendable issues

* Allocate ByteBuffer in readSync

* Update read_10000_chunks_from_file alloc count

* Add UnsafeTransfer to NIOPosix.

Use in NonBlockingFileIO.openFile functions

* Update Sources/NIOPosix/NonBlockingFileIO.swift

Co-authored-by: George Barnett <gbarnett@apple.com>

* formatting, docc

* update comment

* replace openFile with withOpenFile

* More indentation

* Update comments

* Remove docc links to NIOCore types

* Fix read docc links

* Catch errors when closing file handle in withOpenFile

* rename to withFileHandle

* Fix double close on error

Also
- move @available above each function
- Remove wording about separate from Task pool

* Update Sources/NIOPosix/NonBlockingFileIO.swift

Co-authored-by: George Barnett <gbarnett@apple.com>

* withOpenFile is now withFileRegion

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
2023-11-16 16:21:21 +00:00
..