@@ -12,6 +12,7 @@ This library supports the parallelization of Symfony Console commands.
12
12
- [ Batches] ( #batches )
13
13
- [ Configuration] ( #configuration )
14
14
- [ Hooks] ( #hooks )
15
+ - [ Differences with Amphp/ReactPHP] ( #differences-with-amphpreactphp )
15
16
- [ Contribute] ( #contribute )
16
17
- [ Upgrade] ( #upgrade )
17
18
- [ Authors] ( #authors )
@@ -266,6 +267,30 @@ The library supports several process hooks which can be configured via
266
267
* : When using the ` Parallelization ` trait, those hooks can be directly configured by overriding the corresponding method.
267
268
268
269
270
+ ## Differences with Amphp/ReactPHP
271
+
272
+ If you came across this library and wonder what the differences are with [ Amphp] or [ ReactPHP] or other potential
273
+ parallelization libraries, this section is to highlight a few differences.
274
+
275
+ The primary difference is the parallelization mechanism itself. Amphp or ReactPHP work by spawning a pool of workers and
276
+ distributing the work to those. This library however, spawns a pool of processes. To be more specific, the differences
277
+ lies in how the spawn processed are used:
278
+
279
+ - An Amphp/ReactPHP worker can share state; with this library however you cannot easily do so.
280
+ - A worker may handle multiple jobs, whereas with this library the process will be killed after each segment is
281
+ completed. To bring it to a similar level, it would be somewhat equivalent to consider the work of handling a
282
+ segment in this library as a Amphp/ReactPHP worker task, and that the worker is killed after handling a single task.
283
+
284
+ The other difference is that this library works with a command as its central point. This offers the following advantages:
285
+
286
+ - No additional context need to be provided: once in your child process, you are in your command as usual. No custom
287
+ bootstrap is necessary.
288
+ - The command can be executed with and without parallelization seamlessly. It is also trivial to mimic the execution of
289
+ a child process as it is a matter of using the ` --child ` option and passing the child items via the STDIN.
290
+ - It is easier to adapt the distribution of the load and memory leaks of the task by configuring the segment and batch
291
+ sizes.
292
+
293
+
269
294
## Contribute
270
295
271
296
Contributions to the package are always welcome!
@@ -293,8 +318,10 @@ See the [upgrade guide](UPGRADE.md).
293
318
All contents of this package are licensed under the [ MIT license] .
294
319
295
320
321
+ [ Amphp ] : https://amphp.org/
296
322
[ Composer ] : https://getcomposer.org
297
323
[ Bernhard Schussek ] : http://webmozarts.com
324
+ [ ReactPHP ] : https://reactphp.org/
298
325
[ Théo Fidry ] : http://webmozarts.com
299
326
[ The Community Contributors ] : https://github.com/webmozarts/console-parallelization/graphs/contributors
300
327
[ issue tracker ] : https://github.com/webmozarts/console-parallelization/issues
0 commit comments