Skip to content

Commit c2a5d8e

Browse files
committed
Update readme
1 parent 09f243f commit c2a5d8e

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# parallel-functions
22

3-
[![Build Status](https://img.shields.io/travis/amphp/parallel-functions/master.svg?style=flat-square)](https://travis-ci.org/amphp/parallel-functions)
3+
AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.
4+
`amphp/parallel-functions` provides a utility function which wraps a callable into another callable which will execute on another process or thread. All data within the callable object or closure must be serializable.
5+
6+
See the `Worker` and `Task` interfaces in [`amphp/parallel`](https://github.com/amphp/parallel) for a more flexible and customizable API for running tasks in parallel.
7+
8+
[![Latest Release](https://img.shields.io/github/release/amphp/parallel-functions.svg?style=flat-square)](https://github.com/amphp/parallel-functions/releases)
49
![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)
510

611
## Installation
@@ -13,29 +18,30 @@ composer require amphp/parallel-functions
1318

1419
## Requirements
1520

16-
- PHP 7.4+
17-
18-
## Documentation
19-
20-
Documentation can be found on [amphp.org](https://amphp.org/parallel-functions/) as well as in the [`./docs`](./docs) directory.
21+
- PHP 8.1+
2122

2223
## Example
2324

2425
```php
2526
<?php
2627

2728
use function Amp\ParallelFunctions\parallelMap;
28-
use function Amp\Promise\wait;
2929

30-
$responses = wait(parallelMap([
30+
$responses = parallelMap([
3131
'https://google.com/',
3232
'https://github.com/',
3333
'https://stackoverflow.com/',
3434
], function ($url) {
3535
return file_get_contents($url);
36-
}));
36+
});
3737
```
3838

39+
Note that `file_get_contents()` is being used here as an example _blocking_ function (that is, a function which halts the process while awaiting I/O).
40+
41+
We recommend performing HTTP requests using [`amphp/http-client`](https://github.com/amphp/http-client).
42+
43+
The best functions to parallelize are those which perform many CPU-intensive calcuations or blocking functions which would be difficult or time-consuming to implement in a non-blocking way.
44+
3945
Further examples can be found in the [`./examples`](examples) directory.
4046

4147
## Versioning
@@ -44,7 +50,7 @@ Further examples can be found in the [`./examples`](examples) directory.
4450

4551
## Security
4652

47-
If you discover any security related issues, please email [`[email protected]`](mailto:[email protected]) instead of using the issue tracker.
53+
If you discover any security related issues, please use the private security issue reporter instead of using the public issue tracker.
4854

4955
## License
5056

0 commit comments

Comments
 (0)