mirror of
https://github.com/amphp/parallel.git
synced 2025-02-23 22:32:31 +01:00
108 lines
5.9 KiB
Markdown
108 lines
5.9 KiB
Markdown
# Change log
|
|
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
|
## [0.3.0] - 2016-01-15
|
|
### Added
|
|
- Added `Amp\Concurrent\Worker\factory()` function that accesses or sets the global worker factory.
|
|
- Added `Amp\Concurrent\Worker\get()` function that returns a worker from the global worker pool.
|
|
|
|
### Changed
|
|
- `Amp\Concurrent\Worker\Environment` is now an interface, with `Amp\Concurrent\Worker\BasicEnvironment` being the default implementation provided to workers that is then provided to `Amp\Concurrent\Worker\Task::run()`. Workers with different implementations of `Environment` can be easily created for particular applications.
|
|
- `Amp\Concurrent\Worker\Queue` has been removed. The functionality of queues has been merged into `Amp\Concurrent\Worker\Pool` through a new `get()` method that returns a worker from the pool. The returned worker is marked as busy until all references have been destroyed. See the example code below.
|
|
|
|
```php
|
|
use Amp\Concurrent\Worker\DefaultPool;
|
|
|
|
$pool = new DefaultPool();
|
|
$pool->start();
|
|
$worker = $pool->get(); // Marks $worker as busy in the pool.
|
|
|
|
// Use $worker for a series of tasks.
|
|
|
|
$worker = null; // Marks worker as idle in the pool.
|
|
```
|
|
|
|
## [0.2.2] - 2015-12-21
|
|
### Added
|
|
- Added the `Amp\Concurrent\Strand` interface that combines `Amp\Concurrent\Context` and `Amp\Concurrent\Sync\Channel`. This interface is implemented by the following classes (note that these classes implemented the two component interface separately, so no changes were made to the implementation):
|
|
- `Amp\Concurrent\Forking\Fork`
|
|
- `Amp\Concurrent\Threading\Thread`
|
|
- `Amp\Concurrent\Process\ChannelledProcess`
|
|
|
|
### Changed
|
|
- `Amp\Concurrent\Strand` interface is now required by the constructor of `Amp\Concurrent\Worker\AbstractWorker`.
|
|
|
|
|
|
## [0.2.1] - 2015-12-16
|
|
### Added
|
|
- Added `Amp\Concurrent\Worker\DefaultQueue` implementing `Amp\Concurrent\Worker\Queue` that provides a queue of workers that can be pulled and pushed from the queue as needed. Pulling a worker marks it as busy and pushing the worker back into the queue marks it as idle. If no idle workers remain in the queue, a worker is selected from those marked as busy. A worker queue allows a set of interdependent tasks (for example, tasks that depend on an environment value in the worker) to be run on a single worker without having to create and start separate workers for each task.
|
|
|
|
### Fixed
|
|
- Fixed bug where exit status was not being read in `Amp\Concurrent\Process\Process`, which also caused `Amp\Concurrent\Worker\WorkerProcess` to fail.
|
|
|
|
## [0.2.0] - 2015-12-13
|
|
### Changed
|
|
- Updated to Amp `0.9.x` packages.
|
|
- All exceptions now implement the `Amp\Exception\Throwable` interface.
|
|
- All interface names have been changed to remove the Interface suffix.
|
|
- `Sync\Channel` was renamed to `Sync\ChannelledStream`.
|
|
- `Sync\Parcel` was renamed to `Sync\SharedMemoryParcel`.
|
|
- `Worker\Worker` has been renamed to `Worker\AbstractWorker`.
|
|
- `Worker\Pool` has been renamed to `Worker\DefaultPool`.
|
|
- `Worker\WorkerFactory` is now an interface, with the default implementation as `Worker\DefaultWorkerFactory`.
|
|
|
|
### Fixed
|
|
- Fixed bug where workers would begin throwing `BusyError`s when tasks are enqueued simultaneously or between multiple coroutines.
|
|
- Fixed bugs with worker shutdowns conflicting with tasks already running.
|
|
- Fixed race conditions with pools occurring when enqueuing many tasks at once.
|
|
- Fixed issue with contexts failing without explanation if the returned value could not be serialized.
|
|
|
|
|
|
## [0.1.1] - 2015-11-13
|
|
### Added
|
|
- Runtime support for forks and threads can now be checked with `Forking\Fork::enabled()` and `Threading\Thread::enabled()`, respectively.
|
|
|
|
### Changed
|
|
- Creating a fork will now throw an `UnsupportedError` if forking is not available.
|
|
- Creating a thread will now throw an `UnsupportedError` if threading is not available.
|
|
- Creating a `Sync\Parcel` will now throw an `UnsupportedError` if the `shmop` extension is not enabled.
|
|
- Creating a `Sync\PosixSemaphore` will now throw an `UnsupportedError` if the `sysvmsg` extension is not enabled.
|
|
|
|
### Fixed
|
|
- Fixed `Worker\Pool::__construct()` using `$minSize` as the maximum pool size instead.
|
|
- `Process\Process` no longer reports as running during process destruction after calling `kill()`.
|
|
|
|
|
|
## [0.1.0] - 2015-10-28
|
|
### Changed
|
|
- `Sync\ParcelInterface::wrap()` was removed in favor of `synchronized()`, which now passes the value of the parcel to the callback function. The value returned by the callback will be wrapped.
|
|
- Both channel interfaces were combined into `Sync\Channel`.
|
|
- `ContextInterface` no longer extends a channel interface
|
|
- `Forking\Fork` and `Process\Process` now implement `ProcessInterface`.
|
|
- Updated `icicleio/stream` to v0.4.1.
|
|
|
|
### Fixed
|
|
- Fixed issue with error handler in `Sync\Channel` catching unrelated errors until the next tick.
|
|
|
|
|
|
## [0.1.0-beta1] - 2015-09-28
|
|
First release.
|
|
|
|
### Added
|
|
- Creating and controlling multiple threads with `Threading\Thread`.
|
|
- Creating and controlling multiple forked processes with `Forking\Fork`.
|
|
- Workers and tasks, which can use either threading, forks, or a separate PHP process.
|
|
- A global worker pool that any tasks can be run in.
|
|
- Channels for sending messages across execution contexts.
|
|
- Parcels for storing values and objects in shared memory locations for use across contexts.
|
|
- Non-blocking mutexes and semaphores for protecting parcels.
|
|
|
|
|
|
[0.3.0]: https://github.com/icicleio/concurrent/releases/tag/v0.3.0
|
|
[0.2.2]: https://github.com/icicleio/concurrent/releases/tag/v0.2.2
|
|
[0.2.1]: https://github.com/icicleio/concurrent/releases/tag/v0.2.1
|
|
[0.2.0]: https://github.com/icicleio/concurrent/releases/tag/v0.2.0
|
|
[0.1.1]: https://github.com/icicleio/concurrent/releases/tag/v0.1.1
|
|
[0.1.0]: https://github.com/icicleio/concurrent/releases/tag/v0.1.0
|
|
[0.1.0-beta1]: https://github.com/icicleio/concurrent/releases/tag/v0.1.0-beta1
|