A non-blocking concurrency framework for PHP applications. 🐘
ForbidCloning
and ForbidSerialization
traits as a convenient way to forbid cloning and/or serialization in a class.Closable
interface for closable resources such as streams (the interface of the same name will be removed from amphp/byte-stream
in a future release) (#387)CombinedCancellationToken
(#384)Note: This is a pre-release, there might be breaking changes in the final stable version.
Future
template parameter as covariantrevolt/event-loop
v0.2.xUnhandledFutureError
DeferredCancellation
when destroyed (#382)CompositeLengthException
(#383)
race
→ awaitFirst
any
→ awaitAny
some
→ awaitAnyN
settle
→ awaitAll
all
→ await
Note: This is a pre-release, there might be breaking changes in the final stable version.
Amp\async
(#379)Note: This is a pre-release, there might be breaking changes in the final stable version.
revolt/event-loop
dependency declaration to use released ^0.1
version.Note: This is a pre-release, there might be breaking changes in the final stable version.
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.
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 optional Cancellation
, which can be used as a replacement for Amp\Promise\timeout()
.Amp\Promise\rethrow()
anymore.Future::ignore()
.CancellationToken
has been renamed to Cancellation
CancellationTokenSource
has been renamed to DeferredCancellation
NullCancellationToken
has been renamed to NullCancellation
TimeoutCancellationToken
has been renamed to TimeoutCancellation
CombinedCancellationToken
has been renamed to CompositeCancellation
EventDriver
(#358)EventDriver
feature configuration to work with different kinds of FDs, e.g. under certain conditions in docker containers (#360)Deferred::isResolved()
stream_select
errors due to signal interruptions (#338)
Fixes stream_select
handling on signal interruptions on PHP 8 and
avoids suppressing errors that shouldn't be suppressed.