This repository was archived by the owner on Oct 1, 2023. It is now read-only.
v4.58.0: HSL-IO v0.2: buffered readers, FDHandle, removal of write queuing, disposables, and PHP resource support
This release:
- increases the version number of the
hsl-iovirtual package to 0.2.0 - removes
CloseableHandle::closeAsync()- useclose()instead - adds convenience methods
readAllAsync(),readFixedSizeAsync(),writeAllAsync()toIO\ReadHandle - adds
IO\BufferedReaderclass, which implementsIO\ReadHandleand adds:linesIterator()- use asforeach ($reader->linesIterator() await as $line) {}readLineAsync()- prefer usinglinesIterator()where appropriatereadUntilAsync()readByteAsync()
- adds
IO\MemoryHandleclass O_CLOEXECis now implicitly set on all handles; this will not affect most users, but removes an observable difference when using CLI-server mode- Removed disposable interfaces; file/socket open functions now return the non-disposable interface.
- removed queuing system from
IO\WriteHandle, as it can not provide the guarantees that would intuitively be expected. In general, avoid concurrent writes to the same handle, or add a queue or lock for your higher-level operations instead of each individual IO operation. - PHP resource support in HSL IO has been removed; all native handles have been ported to
OS\FileDescriptor - Fixed a bug where non-blocking accepts would never resolve (fail) if the socket was already closed
- Added
OS\mkostemps(),OS\mkostemp(),OS\mkstemp(),OS\mkstemps();File\temporary_file()now uses these - Added
IO\FDHandleinterface for handles that are backed byOS\FileHandles; all native types now implement this interface - Removed UserSpaceHandle; check for the behavior you want instead, e.g.
OS\FileHandle - invalid arguments in HSL IO now consistently fail with
EINVAL, instead of a mix of different exceptionsEINVALis used for consistency regardless of when there error is raised by Hack code or by native functions