Skip to content

Releases: amphp/parallel

0.2.2

23 Jan 04:21
7ef75bd
Compare
Choose a tag to compare
  • Fixed using the Process context inside PHARs.
  • Added PHP_BINDIR to PHP executable search path list, fixing locating the executable in environments where the PATH environment variable may not be set, such as FPM on nginx (#36).

0.2.1

27 Dec 19:21
0d40e6d
Compare
Choose a tag to compare
  • Removed cyclic references in Context\Thread, Context\Process, Worker\AbstractWorker, and Worker\DefaultPool so objects would be garbage collected immediately (see amphp/parallel-functions#5).

0.2.0

14 Dec 17:43
c545be1
Compare
Choose a tag to compare

(Note all class and interface names below are relative to Amp\Parallel)

  • The forking context has been completely removed. Forking the entire process state proved to be too error-prone to be useful as a general-purpose parallel execution context.
  • Sync\Mutex and Sync\Semaphore interfaces and related classes have been moved to amphp/sync.
  • Thread and process contexts are now found in the Context namespace. Process\ChannelledProcess renamed to Context\Process and Threading\Thread renamed to Context\Thread. The interface Context has also been moved into the Context namespace, along with related exception classes, ContextException and StatusError.
  • Removed the Strand interface. Context\Context now extends Sync\Channel.
  • The process context now accepts a path to a PHP script returning a callable function. This function may return a serializable value, a promise or generator (run as a coroutine) that resolves to a serializable value. An instance of Sync\Channel is given as the only function parameter. $argc and $argv are also available as usual in CLI PHP scripts.
// process.php
use Amp\Parallel\Sync\Channel;
return function (Channel $channel) use ($argc, $argv) {
    // Code executed in child process.
    return $result;
};
  • Threading\Thread::spawn() renamed to Context\Thread::run().
  • Threading\Paracel renamed to Sync\ThreadedParcel.
  • PanicError renamed to Sync\PanicError.
  • Worker\Worker::start() removed. It is no longer necessary to manually start a worker or pool, the underlying context will automatically be started once a task is enqueued.
  • Removed Worker\Pool::getMinSize()and the $minSize parameter from Worker\DefaultPool::__construct().
  • When using an SAPI other than CLI, Context\Process will automatically search PATH for an executable named php. Alternatively, a path to the PHP binary executable may be specified by setting an environment variable or constant named AMP_PHP_BINARY.

0.1.8

18 Jul 04:06
Compare
Choose a tag to compare
  • Defined a constant AMP_WORKER in the process created by WorkerProcess to easily identify when code is being run inside a worker.
  • Reduced the default minimum pool size from 4 to 1.
  • The global Pool instance set in Amp\Parallel\Worker\pool() is not started until it is used instead of being started as soon as it is created/set.

0.1.7

29 Jun 05:04
v0.1.7
c22d283
Compare
Choose a tag to compare
  • Removed int type-declaration on code parameter in constructor of PanicError, TaskException, and TaskError because PDO may use a string for the exception code (#19).

0.1.6

23 Jun 14:55
v0.1.6
Compare
Choose a tag to compare
  • Unreference stderr reader (regression in v0.1.5 that kept the loop running on idle watchers)

0.1.5

21 Jun 16:27
v0.1.5
Compare
Choose a tag to compare
  • Prevent display_errors=1 to break workers.
  • Pipe stderr of worker processes to stderr of the parent.

0.1.4

21 Jun 04:24
29a1d1b
Compare
Choose a tag to compare
  • Fixed an issue where fast-finishing or blocking tasks issued to a worker simultaneously would resolve the promises returned from Worker::enqueue() in reverse order. (Note that enqueued tasks may still finish out of order. Order is only maintained for tasks that block the worker or finish immediately.)

0.1.3

19 Jun 17:46
998a255
Compare
Choose a tag to compare
  • Fixed an issue where a worker process could hang if the parent context died.
  • Improved error reporting when a worker dies.

0.1.2

17 Jun 21:25
v0.1.2
Compare
Choose a tag to compare
  • Skip cli_set_process_title inside phpdbg as it's not defined there.