Releases: amphp/amp
Releases · amphp/amp
3.0.0 Beta 6
- Added
ForbidCloning
andForbidSerialization
traits as a convenient way to forbid cloning and/or serialization in a class.
3.0.0 Beta 5
- Added
Closable
interface for closable resources such as streams (the interface of the same name will be removed fromamphp/byte-stream
in a future release) (#387)
2.6.2
3.0.0 Beta 4
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Mark
Future
template parameter as covariant - Add compatibility with
revolt/event-loop
v0.2.x - Improve exception message of
UnhandledFutureError
- Cancel
DeferredCancellation
when destroyed (#382) - Rename combinators, introduce
CompositeLengthException
(#383)race
→awaitFirst
any
→awaitAny
some
→awaitAnyN
settle
→awaitAll
all
→await
- The old names have been kept for a migration phase, but will be removed before the final v3 release.
3.0.0 Beta 3
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Add optional args to
Amp\async
(#379)
3.0.0 Beta 2
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Fixed
revolt/event-loop
dependency declaration to use released^0.1
version.
3.0.0 Beta 1
Note: This is a pre-release, there might be breaking changes in the final stable version.
Event Loop
Amp no longer ships its own event loop. It's now based on Revolt. Revolt\EventLoop
is quite similar to Amp's previous Amp\Loop
. A very important difference is using float $seconds
instead of int $milliseconds
for timers.
Futures
Future
is a replacement for the previous Promise
. It's await()
method is based on fibers and replaces generator based coroutines / Amp\Promise\wait()
.
await()
accepts an optionalCancellation
, which can be used as a replacement forAmp\Promise\timeout()
.- Unhandled errors are now automatically thrown into the event loop, so there's no need for
Amp\Promise\rethrow()
anymore. - Unhandled errors can be ignored using
Future::ignore()
.
Cancellation
CancellationToken
has been renamed toCancellation
CancellationTokenSource
has been renamed toDeferredCancellation
NullCancellationToken
has been renamed toNullCancellation
TimeoutCancellationToken
has been renamed toTimeoutCancellation
CombinedCancellationToken
has been renamed toCompositeCancellation