mirror of
https://github.com/danog/amp.git
synced 2024-12-11 00:49:48 +01:00
6.8 KiB
6.8 KiB
2.2.1
- Fixed backpressure release on
Emitter::emit()
, the backpressure is now released as soon as the value is consumed, instead of the next value being requested.
2.2.0
- Added
CombinedCancellationToken
- Added
delay()
as shortcut fornew Delayed
2.1.2
- Fixed issue where the loop time in
NativeDriver
was not refreshed after waiting for I/O streams (#256) - Fixed compatibility issue of
NativeDriver
withpcntl_async_signals()
(#264) - A custom queue is now used for timers in
NativeDriver
to allow cancelled timers to be garbage collected immediately instead of after their original expiration time (#220) - Resolving a promise with an object that throws when destructed will now forward that exception to the event loop error handler (#271)
- Fixed loop time to support 32-bit systems (#252, #273)
2.1.1
- Fixed a bug in NativeDriver causing 100% CPU usage when any timers were used (#251)
2.1.0
- Make use of
hrtime()
as monotonic time source if available (PHP 7.3) - Added
Amp\Iterator\toArray()
- Added
Amp\Promise\timeoutWithDefault()
(#245) - Added
Amp\Promise\wrap()
(#234) - Added
Amp\Loop::now()
- Fixed stale
NativeDriver::$now
values (#243)
2.0.7
- Fixed recording of stack traces for double resolution in case
AMP_DEBUG
was not set as environment variable, defaulting to0
now. (#217) Loop::unreference()
is ignored on invalid watchers now.- Invoke UV watchers in case no events or
UV_DISCONNECT
is indicated. - Ignore
Loop::$driver
not being set during shutdown, which might happen due to the unreliable shutdown order. (#212)
2.0.6
- Resolution methods are now hidden in the
Promise
returned fromDeferred::promise()
. Their exposure was an implementation detail and never promised by the return type ofDeferred::promise()
. - A named class is now used for promises, so you don't end up with an anonymous class in
var_dump()
and stack traces, which can be confusing.
2.0.5
- Fixed possible notices in
formatStacktrace()
. This is an internal API, but the notices might appear on certain stack traces when running withAMP_DEBUG=true
. - Fixed segfault with
ev
, see amphp/parallel-functions#3. - Dropped multiple definitions of
Deferred
andEmitter
. These were introduced as performance hack, but relied onzend.assertions
being disabled to change behavior, which is bad. The performance impact is believed to be rather low, because coroutines are used a lot more thanDeferred
in Amp v2.
2.0.4
- Allow
AMP_DEBUG
to be defined via the environment. - Fix formatting of stack traces used for double resolution debugging.
2.0.3
Loop::set()
replaces the current driver with a dummy driver for the time ofgc_collect_cycles()
now. This allows cyclic references to be cleaned up properly before the new driver is set. Without such a fix, cyclic references might have been cleaned up later, e.g. cancelling their watcher IDs on the new loop, thereby cancelling the wrong watchers.- Promise combinator functions (
all(),
any(),
first(),
some()) now preserve order of the given
$promises` array argument.
2.0.2
- Fixed warnings and timers in
EventDriver
. - Does no longer hide warnings from
stream_select
.
2.0.1
- Fixed an issue where the loop blocks even though all watchers are unreferenced.
2.0.0
Amp\reactor()
has been replaced withAmp\Loop::set()
andAmp\Loop::get()
.Amp\driver()
has been replaced withAmp\Loop\Factory::create()
.Amp\tick()
no longer exists and doesn't have a replacement. Ticks are an internal detail.- Functions for creating and managing watchers are now static methods of
Amp\Loop
instead of functions in theAmp
namespace.once()
is nowdelay()
andimmediately()
isdefer()
.- Parameter order for
delay()
andrepeat()
has been changed. reference()
andunreference()
have been added.
Amp\Pause
has been renamed toAmp\Delayed
and accepts an optional resolution value now. Additionallyreference()
andunreference()
methods have been added.- Promise accepting functions have been moved to the
Amp\Promise
namespace. Amp\Promise\some()
accepts an additional$required
parameter.Amp\call()
,Amp\asyncCall()
,Amp\coroutine()
andAmp\asyncCoroutine()
have been added.Amp\resolve()
has been removed, useAmp\call()
instead.Promise::when()
has been renamed toPromise::onResolve()
Promise::watch()
has been removed, useAmp\Iterator
,amphp/byte-stream
or a custom implementation that implementsAmp\Promise
instead and provides dedicated APIs to access the previously data shared via thewatch()
mechanism.Amp\Iterator
,Amp\Emitter
andAmp\Producer
have been added with several functions in theAmp\Iterator
namespace.- Various other changes.
1.2.2
- Fix notice in
NativeReactor
when removing a handle while an event is waiting for it. (Regression fix from 1.1.1)
1.2.1
- Fix
uv_run()
potentially exiting earlier than intended, leading to an infinite loop inUvReactor::run()
.
1.2.0
resolve()
now also accepts callables returning generators.
1.1.1
- Fix memory leak in
NativeReactor
, retaining an empty array for each stream. - Remove circular references in
UvReactor
to avoid garbage collector calls.
1.1.0
- Add
getExceptions()
method toCombinatorException
to get an array of all the exceptions (affectingsome()
andfirst()
). - Fix
NativeReactor
not ending up in stopped state if primary callback didn't install any events.
1.0.8
- Fix
NativeReactor
running a busy loop if no timers are active. Properly block now in NativeReactor insidestream_select()
.
1.0.7
- Several combinator functions could result in a promise already resolved exception in case some values of the array weren't promises.
1.0.6
- Fix issue in
NativeReactor
causingstop()
to be delayed by one second.
1.0.5
- Convert general
RuntimeException
to more specificAmp\CombinatorException
.
1.0.4
- Repeat watchers in
LibeventReactor
internally were handled in microsecond intervals instead of milliseconds.
1.0.3
- Fix issue in
NativeReactor
capable of causing keep alive counter corruption when a watcher was cancelled inside its own callback. - Fix issue in
UvReactor
withlibuv
>= 1.1.0 causing busy loop with immediates present, but no watchers being triggered.
1.0.2
- Fix PHP 7 issue in which top-level
Throwable
s weren't caught in certain coroutine contexts. - Remove error suppression operator on optionally
null
option assignment to avoid spuriousE_NOTICE
output when custom error handlers are used.
1.0.1
- Fix bug preventing
UvReactor::tick()
from returning when no events are ready for a single active IO watcher.
1.0.0
- Initial stable API release