Skip to content

2.0.0 Beta 1

Pre-release
Pre-release
Compare
Choose a tag to compare
@trowski trowski released this 08 Feb 05:04
d491b02

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