Releases: amphp/parallel
Releases · amphp/parallel
2.2.3
What's Changed
- Fixed accepting a socket with
SocketIpcHub::accept()after cancelling a prior accept operation.
Full Changelog: v2.2.2...v2.2.3
2.2.2
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, andTaskFailureErrorto 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
Processrenamed toProcessContextParallelrenamed toThreadContextContext::isRunning()andContext::kill()replaced byContext::isClosed()andContext::close()- Context related functions:
run→startContextfactory→contextFactorycreatehas 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
ContextPanicErrororTaskFailureThrowableto a string, i.e., when the exception is uncaught in the parent and is written to STDERR - Added an optional
Cancellationargument toContextFactory::start()
Worker
Poolrenamed toWorkerPoolandDefaultPoolrenamed toContextWorkerPoolTaskWorkerhas been marked as internal. Use aWorkerFactoryto createWorkerinstances or useWorkerPool::getWorker()to get a worker from a poolTaskRunnerhas been removed- Removed deprecated
TaskExceptionandTaskError Worker::enqueue()renamed toWorker::submit(), which now returns anExecutionobjectExecution::getFuture()returns a future that resolves to the eventual return value of theTaskExecution::await()awaits the result of theTask, it is a shortcut to callingExecution::getFuture()->await()Execution::getChannel()returns aChannelthat can be used to communicate with theChannelprovided toTask::run()- The arguments to
Task::run()have changed toChannelandCancellation
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
ContextPanicErrororTaskFailureThrowableto 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
Cancellationargument toProcessContext::start()andContextFactory::start() - Fix signals terminating child processes if a handler was not created in the child
- Updated for compatibility of
2.0ofamphp/socket
1.4.2
2.0.0 Beta 4
- Added compatibility with Revolt v1.x