Releases: amphp/parallel
Releases · amphp/parallel
0.2.4
0.2.3
0.2.2
0.2.1
- Removed cyclic references in
Context\Thread
,Context\Process
,Worker\AbstractWorker
, andWorker\DefaultPool
so objects would be garbage collected immediately (see amphp/parallel-functions#5).
0.2.0
(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
andSync\Semaphore
interfaces and related classes have been moved toamphp/sync
.- Thread and process contexts are now found in the
Context
namespace.Process\ChannelledProcess
renamed toContext\Process
andThreading\Thread
renamed toContext\Thread
. The interfaceContext
has also been moved into theContext
namespace, along with related exception classes,ContextException
andStatusError
. - Removed the
Strand
interface.Context\Context
now extendsSync\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 toContext\Thread::run()
.Threading\Paracel
renamed toSync\ThreadedParcel
.PanicError
renamed toSync\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 fromWorker\DefaultPool::__construct()
. - When using an SAPI other than CLI,
Context\Process
will automatically search PATH for an executable namedphp
. Alternatively, a path to the PHP binary executable may be specified by setting an environment variable or constant namedAMP_PHP_BINARY
.
0.1.8
- Defined a constant
AMP_WORKER
in the process created byWorkerProcess
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 inAmp\Parallel\Worker\pool()
is not started until it is used instead of being started as soon as it is created/set.
0.1.7
0.1.6
0.1.5
0.1.4
- 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.)