This library uses the default process pool of `amphp/parallel` by default.
You usually don't have to pass a custom `Amp\Parallel\Worker\Pool` instance to the functions provided.
If you need a different configuration other than the default, it's usually best to re-configure the default worker pool in `amphp/parallel` instead of passing a custom instance, which can be configured using `Amp\Parallel\Worker\pool()`.
The default maximum number of workers is 32, which you probably want to lower in a traditional web environment, but which is fine for most other usages, such as background scripts running via the CLI version of PHP.
All you need is wrapping every function returning an [`Amp\Promise`](https://amphp.org/amp/promises/) with [`Amp\Promise\wait()`](https://amphp.org/amp/promises/miscellaneous#wait).
> Writing to `STDOUT` using `echo`, `print`, `var_dump`, etc. inside functions executed in parallel is not recommended for producing script output, only for debugging purposes. Output may be interleaved and ordering is not necessarily predictable.
`Amp\ParallelFunctions\parallel(callable, Amp\Parallel\Worker\Pool|null): callable` wraps a [`callable`](https://secure.php.net/callable), so it's executed in another thread / process on invocation.
The default worker pool (the pool returned by `Amp\Parallel\Worker\pool()`) will be used unless an optional `Amp\Parallel\Worker\Pool` instance is provided.
Any callable can be used with this function, including instances of [`\Closure`](https://secure.php.net/Closure) or class instance methods. Classes used in a callable must be autoloadable using the [Composer autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading).
`Amp\ParallelFunctions\parallelMap(array, callable, Amp\Parallel\Worker\Pool|null): Promise` works similar to [`array_map()`](https://secure.php.net/array_map), but has a different signature.
`Amp\ParallelFunctions\parallelFilter(array, callable, int, Amp\Parallel\Worker\Pool|null): Promise` works like [`array_filter()`](https://secure.php.net/array_filter), but returns a promise and executes in parallel.