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.37: IO renamed interfaces, sealing changes

18 Dec 18:56
Compare
Choose a tag to compare

This release:

  • unseals the majority of the public interfaces in HSL IO
  • deprecates the UserspaceHandle interface; directly implement the Handle interface instead (which is no longer sealed)

4.31.1: bugfixes to IO\ and File\ interface hierarchy

25 Nov 21:10
Compare
Choose a tag to compare

Several interfaces had incomplete lists of parent interfaces; in particular, several of the file interfaces did not extend the appropriate Seekable interfaces

4.31.0: IO changes

11 Nov 21:28
Compare
Choose a tag to compare

This release:

  • adds TCP\connect_nd_async(), TCP\connect_async(), TCP\Server and equivalents in Unix\
  • refactors file locking:
    • removed the _NON_BLOCKING members of the LockType enum
    • splits lock() into lock() (blocking) and tryLockx() (non-blocking)
    • tryLockx() will throw an AlreadyLockedException if flock() fails with EWOULDBLOCK
  • refactors all other IO\ and File\ exceptions:
    • adds OS\Exception, containing an ErrorCode; ErrorCode contains constants used in C errno or h_error constants
    • removes per-operation exceptions except for locking, e.g. File\WriteException
    • adds convenience subclasses of OS\Exception for common cases, such as AlreadyExistsException
  • adds IO\SeekableHandle, extended by File\Handle
  • adds Debug\dump_async() as a replacement for \var_dump(): if IO\request_output() is used, STDOUT is made non-blocking, so can truncate
  • adds optional timeouts to readAsync(), readLineAsync(), and writeAsync()
  • contains several bugfixes

4.25: remove Async\, add TCP\, improve IO\ and File\

14 Oct 17:10
Compare
Choose a tag to compare

This release:

  • removes the Experimental\Async namespace; it is no longer experimental, and is part of the main HSL library
  • renames open_*_non_disposable to open_*_nd
  • moves close_async() to only be available on non-disposable IO handles; disposable IO handles should only be closed by disposing of them
  • removes File from class names in the File\ namespace
  • removes IO\server_input()
  • adds TCP\connect_async($host, $port) and TCP\connect_nd_async($host, $port)

Only bare minimum TCP connection support is included at present; we expect to expose more socket options in future releases.

4.15.0: target HSL v4.15 and HHVM v4.20

03 Oct 17:29
Compare
Choose a tag to compare

Fixes issues with latest HSL and HHVM releases.

v4.15.x is the last release branch before significant breaking changes to the IO (File) API. Target 4.15.* in your composer.json if your project depends on the old IO API.

Support HSL v4.7

31 May 20:16
Compare
Choose a tag to compare

This release replaces HH\Lib\_Private\Ref<T> (which is no longer available) with HH\Lib\Ref<T>

Add advanced async helper classes

13 May 17:33
Compare
Choose a tag to compare

This release adds:

  • Async\Poll and Async\KeyedPoll: these classes allow you to iterate over a group of awaitables as each finishes
  • Async\Condition: a convenience wrapper around ConditionWaitHandle
  • Async\ConditionNode: a convenience wrapper for building linked lists around Async\Condition
  • Async\Semaphore: a semaphore implementation for async code, allowing limiting concurrency when the awaitables that need limiting are not fully known at the start of execution

This release supports HHVM 4.1 and above.

We strongly recommend avoiding Async\Poll and Async\KeyedPoll wherever possible: while they can be used to solve many problems more easily than other approaches, they can lead to much more inefficient code than alternative approaches, such as storing awaitables or building linked lists of awaitables.

In some cases there is not a more efficient approach, but Async\Poll can hide the performance impact, leading to over-use. In particular, assuming they complete before the end of a request, all awaitables passed to it will complete, even if not requested. For example, if you use Async\Poll to request the same data from memcached, mysql, and an HTTP request endopint, and memcached responds first, CPU and network resources will still be used for the MySQL and CURL requests until they complete, even if the result is unused - and this will not appear in function-level profilers.

Async\Poll should primarily be used when the results of all awaitables are required, but ordering is not.

The primary advantages of using Async\Poll over simply not awaiting awaitables are:

  • if iterated until completion, all awaitables will definitely complete
  • if an awaitable throws an exception but is not awaited, the exception will disappear

Release for HHVM/Hack v4.1

09 Apr 19:22
Compare
Choose a tag to compare

This release removes the DateTime API and contains various internal fixes to support HHVM/Hack v4.1

Fix indefinite hangs when reading form closed files on some platforms

04 Mar 21:48
Compare
Choose a tag to compare
Check for end of file before awaiting

On Linux, awaiting for read on an EOF returns immediately; on Mac, it
never returns. This is a regression caused by the recent fix to not
specify invalid flags to `stream_await()` - the invalid flags made it
/always/ return immediately, hiding this bug.

Test Plan:

`tests/filesystem/FileTest.php` freezes forever on mac without this
change; it passes with it.

Fix indefinite hangs when reading form closed files on some platforms

04 Mar 21:48
Compare
Choose a tag to compare
Check for end of file before awaiting

On Linux, awaiting for read on an EOF returns immediately; on Mac, it
never returns. This is a regression caused by the recent fix to not
specify invalid flags to `stream_await()` - the invalid flags made it
/always/ return immediately, hiding this bug.

Test Plan:

`tests/filesystem/FileTest.php` freezes forever on mac without this
change; it passes with it.