Releases: amphp/parallel
Releases · amphp/parallel
2.2.1
2.2.0
Context::join()
may now be called at any time instead of needing to wait until the context has sent or received all data on its channel.- The backtrace of exceptions thrown in child processes/threads is now included in the message of
ContextPanicError
,TaskFailureException
, andTaskFailureError
to avoid the backtrace being hidden from users due to PHP not callingThrowable::__toString()
on previous exceptions. (#168) - Fixed assigning workers to waiting tasks submitted to
ContextWorkerPool
. Previously, in some circumstances two tasks may have been assigned to a single worker if both were enqueued when the worker finished a prior task. (#177)
1.4.3
2.1.0
2.0.0
Stable release compatible with AMPHP v3 and fibers! 🎉
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType>
have been replaced with ResolutionType
.
All classes related to ext-pthreads
have been removed as this extension does not have releases on PHP 8.x.
Classes in the Amp\Parallel\Sync
namespace have been moved to amphp/sync
.
Context
Process
renamed toProcessContext
Parallel
renamed toThreadContext
Context::isRunning()
andContext::kill()
replaced byContext::isClosed()
andContext::close()
- Context related functions:
run
→startContext
factory
→contextFactory
create
has been removed, usestartContext
- Xdebug ini settings are forwarded to processes created by
ProcessContext
(including workers executing tasks), allowing step debugging through IDEs such as PhpStorm. - Improved UX of uncaught exceptions in child processes and task runs. The full stack trace in the context is displayed when converting the
ContextPanicError
orTaskFailureThrowable
to a string, i.e., when the exception is uncaught in the parent and is written to STDERR - Added an optional
Cancellation
argument toContextFactory::start()
Worker
Pool
renamed toWorkerPool
andDefaultPool
renamed toContextWorkerPool
TaskWorker
has been marked as internal. Use aWorkerFactory
to createWorker
instances or useWorkerPool::getWorker()
to get a worker from a poolTaskRunner
has been removed- Removed deprecated
TaskException
andTaskError
Worker::enqueue()
renamed toWorker::submit()
, which now returns anExecution
objectExecution::getFuture()
returns a future that resolves to the eventual return value of theTask
Execution::await()
awaits the result of theTask
, it is a shortcut to callingExecution::getFuture()->await()
Execution::getChannel()
returns aChannel
that can be used to communicate with theChannel
provided toTask::run()
- The arguments to
Task::run()
have changed toChannel
andCancellation
IpcHub
Inter-process communication is now exposed as part of the public API for potential use outside of the context and worker components.
2.0.0 Beta 5
- Improved UX of uncaught exceptions in child processes and task runs. The full stack trace in the context is displayed when converting the
ContextPanicError
orTaskFailureThrowable
to a string, i.e., when the exception is uncaught in the parent and is written to STDERR - Xdebug ini settings are forwarded to processes created by
ProcessContext
(including workers executing tasks), allowing step debugging through IDEs such as PhpStorm. - Added an optional
Cancellation
argument toProcessContext::start()
andContextFactory::start()
- Fix signals terminating child processes if a handler was not created in the child
- Updated for compatibility of
2.0
ofamphp/socket
1.4.2
2.0.0 Beta 4
- Added compatibility with Revolt v1.x
2.0.0 Beta 3
Update for Closable
interface being moved from amphp/byte-stream
to amphp/amp
.
Amp\Parallel\Ipc\IpcHub
now extendsAmp\Closable
instead ofAmp\ByteStream\Closable
.Amp\Parallel\Process\Context
gained anonClose
method becauseAmp\Sync\Channel
now extendsAmp\Closable
.
2.0.0 Beta 2
- PHP 8.1 is now required.
IpcHub
now extendsClosable
, adding anonClose()
method.