Releases: hhvm/hsl-experimental
4.58.0rc1: bufferedReader improvements, linesIterator
This release follows v4.53.0rc2, which actually required HHVM 4.58 - the HSL-Experimental version number and composer requirements have been adjusted to match.
BufferedReader improvements
readUntilAsync()
now returnsAwaitable<?string>
- added
readUntilxAsync()
which can throwEPIPE
- if
readLineAsync()
reaches end of file, it will return any content there, even if there is no"\n"
readLineAsync()
now returnsAwaitable<?string>
- added
readLineAsyncx()
which can throwEPIPE
- added
lineIterator()
If you have code like while (!$reader->isEndOfFile()) { $line = await $reader->readLineAsync(); }
, we recommend replacing it with foreach ($reader->lineIterator() await as $line) {}
4.53.0rc2: add `IO\MemoryHandle::close()`
Add MemoryHandle::close() (#149) Summary: fixes https://github.com/hhvm/hsl-experimental/issues/147 Pull Request resolved: https://github.com/hhvm/hsl-experimental/pull/149 Reviewed By: kmeht, alexeyt Differential Revision: D22243145 Pulled By: fredemmott fbshipit-source-id: 5d2eb2f402acfa10de56c183908808cd3a0c5991
4.53.0rc1: buffered reads, FDHandle, removal of write queuing, disposables, and PHP resource support
This release:
- increases the version number of the
hsl-io
virtual package to 0.2.0 - removes
CloseableHandle::closeAsync()
- useclose()
instead - adds convenience methods
readAllAsync()
,readFixedSizeAsync()
,writeAllAsync()
toIO\ReadHandle
- adds
IO\BufferedReader
class, which implementsIO\ReadHandle
and adds:readUntilAsync()
, and the convenience methodreadLineAsync()
readByteAsync()
- adds
IO\MemoryHandle
class O_CLOEXEC
is 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\FDHandle
interface 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 exceptionsEINVAL
is used for consistency regardless of when there error is raised by Hack code or by native functions
v4.52.1: provide experimental virtual package for HSL IO
This release provides the hhvm/hsl-io
0.1.0 virtual package.
The intent of this is to allow users to use semver-like dependency requirements on specific parts of hsl-experimental, regardless of the overall version number of hsl-experimental, and to simplify updating when libraries are moved from hsl-experimental to the main HSL.
This is an experiment, and the virtual package may be removed in a future release if it does not solve the real-world problems we are currently seeing.
v4.52.0: IO\ and OS\ progress
This release contains many improvements to IO\
and OS\
, some of which are backwards-incompatible changes.
- Added
OS\Errno
enum - Removed
OS\ErrorCode
enum - renamed
OS\Exception
toOS\ErrnoException
- removed
OS\ErrnoException::getErrorCode()
- useOS\ErrnoException::getErrno()
instead - added
OS\FileDescriptor
class,OS\close()
,OS\fcntl()
,OS\flock()
,OS\lseek()
,OS\open()
,OS\pipe()
,OS\read()
, andOS\write()
functions to support several operations without PHPresource
s; these functions throwOS\ErrnoException
on failure. - renamed
IO\ReadHandle::rawReadBlocking()
toread()
andIO\WriteHandle::rawWriteBlocking()
towrite()
IO\ReadHandle::readAsync()
will now return after one successfulread()
, waiting if necessary, instead of reading until end of fileIO\WriteHandle::writeAsync()
will now return after one successfulwrite()
, waiting if necessary, instead of waiting until all data is written; this means it may now partially succeedIO\ReadHandle::readAsync()
andIO\WriteHandle::writeAsync()
now take?int $timeout_ns = null
, instead of?int $timeout_seconds = null
- An exception is now raised if
0
is specified as the timeout; provide a positive integer, ornull
for no timeout. - removed
IO\ReadHandle::readLineAsync()
; it is likely to be reintroduced in a separate abstraction providing buffered reads in the future IO\pipe()
andFile\
are now implemented withOS\FileDescriptor
's instead of PHPresource
s; they should now reliably through correctOS\ErrnoException
s, rather than only in standalone CLI mode
4.50.1: Fix infinite loop when reading data from closed file handles, and pipes/sockets that are closed on the other end
v4.50.1 Test that readAsync implementations appropriately handle closed resou…
4.37.3: fix infinite loop when reading from closed resources, or pipes/sockets that are closed on the other end
v4.37.3 specifically require-dev older hh-clilib; newer ones have adjusted fo…
4.50: remove "Experimental" from OS\ and IO-related namespace names
These libraries remain experimental, however, we are now depending on the package naming to indicate this.
Using the namespace creates problems when:
- mixing builtins and non-builtins, as will be the case for the OS\ namespace
- releasing - e.g. this backwards-breaking change is painful, but better done sooner rather than just before release
This affects:
- OS\
- IO\
- File\
- Unix\
- TCP\
Other namespaces are likely to be similarly renamed in a later release.
4.37.2: support HHVM 4.44+
Does not break backwards compatibility, HHVM 4.25+ is still supported.
4.37.1: HSL IO - timeout fix, improved documentation
- fixed an issue where timeouts < 1ms could be considered equivalent to 'no timeout' (float to int issue in
stream_await()
) - improved documentation for
IO\ReadHandle::readAsync