Skip to content

Releases: amphp/parallel

2.2.3

25 Nov 00:24
v2.2.3
223c47c

Choose a tag to compare

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

30 Aug 18:15
v2.2.2
f54bb40

Choose a tag to compare

  • Fixed potential hang of a ProcessContext created by DefaultContextFactory if output buffers fill by piping STDOUT and STDERR to the same pipes on the parent process. This also provides parity with the default behavior of ThreadContext.

2.2.1

22 May 04:16
v2.2.1
ba11031

Choose a tag to compare

  • Fixed simultaneous creation of workers in ContextWorkerPool.
  • Fixed the IPC pipe in ProcessContext closing immediately after the process exited which potentially prevented reading the last sent data.

2.2.0

13 May 14:17
v2.2.0
37850ff

Choose a tag to compare

  • 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, and TaskFailureError to avoid the backtrace being hidden from users due to PHP not calling Throwable::__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

26 Mar 17:06
v1.4.3
3aac213

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

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

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

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

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

Choose a tag to compare

2.0.0 Beta 4 Pre-release
Pre-release
  • Added compatibility with Revolt v1.x