131

GitHub - amphp/parallel-functions: Parallel processing made simple.

 6 years ago
source link: https://github.com/amphp/parallel-functions
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

parallel-functions

Installation

This package can be installed as a Composer dependency.

composer require amphp/parallel-functions

Requirements

  • PHP 7.4+

Documentation

Documentation can be found on amphp.org as well as in the ./docs directory.

Example

<?php

use function Amp\ParallelFunctions\parallelMap;
use function Amp\Promise\wait;

$responses = wait(parallelMap([
    'https://google.com/',
    'https://github.com/',
    'https://stackoverflow.com/',
], function ($url) {
    return file_get_contents($url);
}));

Further examples can be found in the ./examples directory.

Versioning

amphp/parallel-functions follows the semver semantic versioning specification like all other amphp packages.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK