Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.4.2
->^2.4.2 || ^3.0.0
^1.5
->^1.5 || ^2.0
^2.0
->^2.0 || ^3.0
Release Notes
amphp/amp (amphp/amp)
v3.0.2
: 3.0.2Compare Source
What's Changed
Closure(mixed...)
annotation toClosure(...)
to support PHPStan.Full Changelog: amphp/amp@v3.0.1...v3.0.2
v3.0.1
: 3.0.1Compare Source
What's Changed
Amp\weakClosure()
with changes made to closure names in PHP 8.4.Full Changelog: amphp/amp@v3.0.0...v3.0.1
v3.0.0
: 3.0.0Compare Source
Event Loop
Amp no longer ships its own event loop. It's now based on Revolt.
Revolt\EventLoop
is quite similar to Amp's previousAmp\Loop
. A very important difference is usingfloat $seconds
instead ofint $milliseconds
for timers though!Promises
Future
is a replacement for the previousPromise
.There's no need for callbacks or
yield
anymore!Its
await()
method is based on fibers and replaces generator based coroutines /Amp\Promise\wait()
.Amp\Deferred
toAmp\DeferredFuture
.Amp\Promise\wait()
: UseAmp\Future::await()
instead, which can be called in any (nested) context unlike before.Amp\call()
: Remove the passed closure boilerplate and allyield
keywords, interruption is handled via fibers now instead of generator coroutines.Amp\asyncCall()
: Replace invocations withAmp\async()
, which starts a new fiber instead of using generators.Amp\coroutine()
: There's no direct replacement.Amp\asyncCoroutine()
: There's no direct replacement.Amp\Promise\timeout()
:Future::await()
accepts an optionalCancellation
, which can be used as a replacement.Amp\Promise\rethrow()
: Unhandled errors are now automatically thrown into the event loop, so there's no need for that function anymore.Future::ignore()
if needed, but should usually be handled in some way.Amp\Promise\wrap()
: UseFuture::finally()
instead.Amp\getCurrentTime()
toAmp\now()
returning the time in seconds instead of milliseconds.Amp\delay()
to accept the delay in seconds now instead of milliseconds.Amp\weakClosure()
to allow a class to hold a self-referencing Closure without creating a circular reference that prevents automatic garbage collection.Amp\trapSignal()
to await one or multiple signals.Promise Combinators
Promise combinators have been renamed:
Amp\Promise\race()
has been renamed toAmp\Future\awaitFirst()
Amp\Promise\first()
has been renamed toAmp\Future\awaitAny()
Amp\Promise\some()
has been renamed toAmp\Future\awaitAnyN()
Amp\Promise\any()
has been renamed toAmp\Future\awaitAll()
Amp\Promise\all()
has been renamed toAmp\Future\await()
CancellationToken
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
.SignalCancellation
has been added.Iterators
Iterators have been removed from
amphp/amp
as normal PHP iterators can be used with fibers now and there's no need for a separate API.However, there's still some need for concurrent iterators, which is covered by the new
amphp/pipeline
library now.Closable
Amp\Closable
has been added as a new basic interface for closable resources such as streams or sockets.Strict Types
Strict types now declared in all library files.
This will affect callbacks invoked within this library's code which use scalar types as parameters.
Functions used with
Amp\async()
are the most likely to be affected by this change — these functions will now be invoked within a strict-types context.amphp/byte-stream (amphp/byte-stream)
v2.1.1
: 2.1.1Compare Source
What's Changed
split()
insplitLines()
.Full Changelog: amphp/byte-stream@v2.1.0...v2.1.1
v2.1.0
: 2.1.0Compare Source
What's Changed
Payload
now implementsStringable
split
by @xtrime-ru in https://github.com/amphp/byte-stream/pull/108New Contributors
Full Changelog: amphp/byte-stream@v2.0.2...v2.1.0
v2.0.2
: 2.0.2Compare Source
Error
when invokinggetStdin()
,getStdout()
, andgetStderr()
if the corresponding STDIO stream had been previously closed. Instead, an already closed stream instance is returned.v2.0.1
: 2.0.1Compare Source
ReadableResourceStream
callingSuspension::resume()
when destroyed, which could throw an exception when suspending from{main}
and an uncaught exception was thrown from the event loop.v2.0.0
: 2.0.0Compare Source
Initial stable release compatible with AMPHP v3 and fibers.
There are a number of renaming and compatibility breaks with
1.x
versions:ResourceStream
InputStream
has been renamed toReadableStream
and now extendsAmp\Closable
. Theread()
method now supports an optionalCancellation
parameter.OutputStream
has been renamed toWritableStream
and now extendsAmp\Closable
.WritableStream::end()
no longer accepts an optional data chunk as parameter.IteratorStream
has been repalced byReadableIterableStream
, which accepts anyiterable
ofstring
s (particularly useful withGenerator
orPipeline
).ResourceInputStream
has been renamed toReadableResourceStream
. Theread()
method has an additional, optional$limit
parameter to specify the maximum number of bytes to read.ResourceOutputStream
has been renamed toWritableResourceStream
.InMemoryStream
has been renamed toReadableBuffer
.OutputBuffer
has been renamed toWritableBuffer
.Payload
now accepts astring
in addition to aReadableStream
and isfinal
now.Payload::buffer()
may only be called once.$limit
param toAmp\ByteStream\buffer()
andPayload::buffer()
to set a limit on the maximum bytes that can be buffered.BufferedReader
, a helper class for reading fromReadableStream
using fixed lengths or delimiters found within the stream (#94)Pipe
.StreamChannel
implementing theChannel
interface fromamphp/sync
.Compression
sub-namespace and renamed toCompressingWritableStream
andDecompressingReadableStream
.CompressingReadableStream
(https://github.com/amphp/byte-stream/pull/99)DecompressingWritableStream
(https://github.com/amphp/byte-stream/pull/99)InputStreamChain
has been renamed toReadableStreamChain
.$options
param ofparseLineDelimitedJson
to$flags
to match thejson_decode
function.amphp/phpunit-util (amphp/phpunit-util)
v3.0.0
: 3.0.0Compare Source
This package has been redesigned for compatibility with AMPHP v3 and fibers.
AsyncTestCase
serves a similar purpose as before, providing helper methods for unit testing within an async context. Each test case is run within a unique fiber to allow suspending during the test run.AsyncTestCase::setUpAsync()
andtearDownAsync()
have been removed. UseAsyncTestCase::setUp()
andtearDown()
instead, as both of these methods are now able to execute async using fibers.AsyncTestCase::createCallback()
now returns aClosure
. Additionally, an optional parameter for expected arguments upon invocation have been added (usesInvocationMocker::with(...)
to set expected arguments).Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.