Skip to content

Releases: amphp/parallel

1.4.3

26 Mar 17:06
v1.4.3
3aac213
Compare
Choose a tag to compare
  • Better fix for class alias being redeclared when opcache preloading is enabled (#159)

2.1.0

25 Mar 22:37
v2.1.0
409a8f2
Compare
Choose a tag to compare
  • ContextPanicError is no longer thrown from receive(), send(), and join() in Context. Only ContextException can now be thrown from these methods. A ContextPanicError will be wrapped instead in a ContextException.

2.0.0

21 Feb 05:11
v2.0.0
d66e3df
Compare
Choose a tag to compare

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 to ProcessContext
  • Parallel renamed to ThreadContext
  • Context::isRunning() and Context::kill() replaced by Context::isClosed() and Context::close()
  • Context related functions:
    • runstartContext
    • factorycontextFactory
    • create has been removed, use startContext
  • 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 or TaskFailureThrowable to a string, i.e., when the exception is uncaught in the parent and is written to STDERR
  • Added an optional Cancellation argument to ContextFactory::start()

Worker

  • Pool renamed to WorkerPool and DefaultPool renamed to ContextWorkerPool
  • TaskWorker has been marked as internal. Use a WorkerFactory to create Worker instances or use WorkerPool::getWorker() to get a worker from a pool
  • TaskRunner has been removed
  • Removed deprecated TaskException and TaskError
  • Worker::enqueue() renamed to Worker::submit(), which now returns an Execution object
    • Execution::getFuture() returns a future that resolves to the eventual return value of the Task
    • Execution::await() awaits the result of the Task, it is a shortcut to calling Execution::getFuture()->await()
    • Execution::getChannel() returns a Channel that can be used to communicate with the Channel provided to Task::run()
    • The arguments to Task::run() have changed to Channel and Cancellation

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

02 Feb 00:29
v2.0.0-beta.5
f113947
Compare
Choose a tag to compare
2.0.0 Beta 5 Pre-release
Pre-release
  • Improved UX of uncaught exceptions in child processes and task runs. The full stack trace in the context is displayed when converting the ContextPanicError or TaskFailureThrowable 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 to ProcessContext::start() and ContextFactory::start()
  • Fix signals terminating child processes if a handler was not created in the child
  • Updated for compatibility of 2.0 of amphp/socket

1.4.2

08 Feb 22:47
v1.4.2
75853e1
Compare
Choose a tag to compare
  • Fixed class alias being redeclared when opcache preloading is enabled (#154)

2.0.0 Beta 4

07 Nov 22:56
v2.0.0-beta.4
57e22cf
Compare
Choose a tag to compare
2.0.0 Beta 4 Pre-release
Pre-release
  • Added compatibility with Revolt v1.x

2.0.0 Beta 3

03 Apr 17:55
v2.0.0-beta.3
cd8086a
Compare
Choose a tag to compare
2.0.0 Beta 3 Pre-release
Pre-release

Update for Closable interface being moved from amphp/byte-stream to amphp/amp.

  • Amp\Parallel\Ipc\IpcHub now extends Amp\Closable instead of Amp\ByteStream\Closable.
  • Amp\Parallel\Process\Context gained an onClose method because Amp\Sync\Channel now extends Amp\Closable.

2.0.0 Beta 2

03 Apr 17:50
v2.0.0-beta.2
8eedcb2
Compare
Choose a tag to compare
2.0.0 Beta 2 Pre-release
Pre-release
  • PHP 8.1 is now required.
  • IpcHub now extends Closable, adding an onClose() method.

2.0.0 Beta 1

08 Feb 05:04
d491b02
Compare
Choose a tag to compare
2.0.0 Beta 1 Pre-release
Pre-release

Initial release compatible with AMPHP v3.

All classes related to ext-pthreads and ext-parallel have been removed as both extension do not have releases on PHP 8.x.

Classes in the Amp\Parallel\Sync namespace have been moved to amphp/sync.

Context

  • Process renamed to ProcessContext
  • Context::isRunning() and Context::kill() replaced by Context::isClosed() and Context::close()
  • Context related functions:
    • runstartContext
    • factorycontextFactory
    • create has been removed, use startContext

Worker

  • Pool renamed to WorkerPool and DefaultPool renamed to DefaultWorkerPool
  • TaskWorker renamed to DefaultWorker
  • TaskRunner has been moved to a function, runTasks
  • Removed deprecated TaskException and TaskError
  • Worker::enqueue() renamed to Worker::submit(), which now returns an Execution object
    • Execution::getResult() returns a future that resolves to the eventual return value of the Task
    • Execution::getChannel() returns a Channel that can be used to communicate with the Channel provided to Task::run()
    • The arguments to Task::run() have changed to Channel, Cache, and Cancellation

1.4.1

25 Oct 20:03
v1.4.1
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.4.0...v1.4.1