Releases: hhvm/hsl-experimental
4.37: IO renamed interfaces, sealing changes
This release:
- unseals the majority of the public interfaces in HSL IO
- deprecates the
UserspaceHandle
interface; directly implement theHandle
interface instead (which is no longer sealed)
4.31.1: bugfixes to IO\ and File\ interface hierarchy
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
This release:
- adds
TCP\connect_nd_async()
,TCP\connect_async()
,TCP\Server
and equivalents inUnix\
- refactors file locking:
- removed the
_NON_BLOCKING
members of theLockType
enum - splits
lock()
intolock()
(blocking) andtryLockx()
(non-blocking) tryLockx()
will throw anAlreadyLockedException
ifflock()
fails withEWOULDBLOCK
- removed the
- refactors all other IO\ and File\ exceptions:
- adds OS\Exception, containing an
ErrorCode
;ErrorCode
contains constants used in Cerrno
orh_error
constants - removes per-operation exceptions except for locking, e.g.
File\WriteException
- adds convenience subclasses of
OS\Exception
for common cases, such asAlreadyExistsException
- adds OS\Exception, containing an
- adds
IO\SeekableHandle
, extended byFile\Handle
- adds
Debug\dump_async()
as a replacement for\var_dump()
: ifIO\request_output()
is used,STDOUT
is made non-blocking, so can truncate - adds optional timeouts to
readAsync()
,readLineAsync()
, andwriteAsync()
- contains several bugfixes
4.25: remove Async\, add TCP\, improve IO\ and File\
This release:
- removes the
Experimental\Async
namespace; it is no longer experimental, and is part of the main HSL library - renames
open_*_non_disposable
toopen_*_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 theFile\
namespace - removes
IO\server_input()
- adds
TCP\connect_async($host, $port)
andTCP\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
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
This release replaces HH\Lib\_Private\Ref<T>
(which is no longer available) with HH\Lib\Ref<T>
Add advanced async helper classes
This release adds:
Async\Poll
andAsync\KeyedPoll
: these classes allow you to iterate over a group of awaitables as each finishesAsync\Condition
: a convenience wrapper aroundConditionWaitHandle
Async\ConditionNode
: a convenience wrapper for building linked lists aroundAsync\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
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
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
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.