Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Releases: hhvm/hsl-experimental

4.58.0rc1: bufferedReader improvements, linesIterator

30 Jun 19:26
Compare
Choose a tag to compare

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 returns Awaitable<?string>
  • added readUntilxAsync() which can throw EPIPE
  • if readLineAsync() reaches end of file, it will return any content there, even if there is no "\n"
  • readLineAsync() now returns Awaitable<?string>
  • added readLineAsyncx() which can throw EPIPE
  • 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()`

26 Jun 17:05
Compare
Choose a tag to compare
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

25 Jun 19:39
Compare
Choose a tag to compare

This release:

  • increases the version number of the hsl-io virtual package to 0.2.0
  • removes CloseableHandle::closeAsync() - use close() instead
  • adds convenience methods readAllAsync(), readFixedSizeAsync(), writeAllAsync() to IO\ReadHandle
  • adds IO\BufferedReader class, which implements IO\ReadHandle and adds:
    • readUntilAsync(), and the convenience method readLineAsync()
    • 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 by OS\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 exceptions
    • EINVAL 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

19 May 21:12
Compare
Choose a tag to compare

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

05 May 19:38
Compare
Choose a tag to compare

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 to OS\ErrnoException
  • removed OS\ErrnoException::getErrorCode() - use OS\ErrnoException::getErrno() instead
  • added OS\FileDescriptor class, OS\close(), OS\fcntl(), OS\flock(), OS\lseek(), OS\open(), OS\pipe(), OS\read(), and OS\write() functions to support several operations without PHP resources; these functions throw OS\ErrnoException on failure.
  • renamed IO\ReadHandle::rawReadBlocking() to read() and IO\WriteHandle::rawWriteBlocking() to write()
  • IO\ReadHandle::readAsync() will now return after one successful read(), waiting if necessary, instead of reading until end of file
  • IO\WriteHandle::writeAsync() will now return after one successful write(), waiting if necessary, instead of waiting until all data is written; this means it may now partially succeed
  • IO\ReadHandle::readAsync() and IO\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, or null 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() and File\ are now implemented with OS\FileDescriptor's instead of PHP resources; they should now reliably through correct OS\ErrnoExceptions, 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

16 Apr 21:02
Compare
Choose a tag to compare
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

16 Apr 21:29
Compare
Choose a tag to compare
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

27 Mar 16:22
Compare
Choose a tag to compare

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+

11 Feb 22:59
Compare
Choose a tag to compare

Does not break backwards compatibility, HHVM 4.25+ is still supported.

4.37.1: HSL IO - timeout fix, improved documentation

27 Jan 22:21
Compare
Choose a tag to compare
  • 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