Skip to content

Commit 43212b0

Browse files
committed
Basic readme
1 parent 8cd292a commit 43212b0

1 file changed

Lines changed: 66 additions & 2 deletions

File tree

README.md

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,66 @@
1-
# reactphp-parallel
2-
ReactPHP bindings around ext-parallel
1+
# ReactPHP Runtime wrapper for ext-parallel
2+
3+
[![Linux Build Status](https://travis-ci.org/WyriHaximus/reactphp-parallel-runtime.png)](https://travis-ci.org/WyriHaximus/reactphp-parallel-runtime)
4+
[![Windows Build status](https://ci.appveyor.com/api/projects/status/1sfdh9g2pvbuw4pp?svg=true)](https://ci.appveyor.com/project/WyriHaximus/reactphp-parallel-runtime)
5+
[![Latest Stable Version](https://poser.pugx.org/WyriHaximus/react-parallel-runtime/v/stable.png)](https://packagist.org/packages/WyriHaximus/react-parallel-runtime)
6+
[![Total Downloads](https://poser.pugx.org/WyriHaximus/react-parallel-runtime/downloads.png)](https://packagist.org/packages/WyriHaximus/react-parallel-runtime)
7+
[![Code Coverage](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-parallel-runtime/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-parallel-runtime/?branch=master)
8+
[![License](https://poser.pugx.org/WyriHaximus/react-parallel-runtime/license.png)](https://packagist.org/packages/wyrihaximus/react-parallel-runtime)
9+
[![PHP 7 ready](http://php7ready.timesplinter.ch/WyriHaximus/reactphp-parallel-runtime/badge.svg)](https://travis-ci.org/WyriHaximus/reactphp-parallel-runtime)
10+
11+
### Installation ###
12+
13+
To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`.
14+
15+
```
16+
composer require wyrihaximus/react-parallel-runtime
17+
```
18+
19+
# Usage
20+
21+
```php
22+
$autoloader = \dirname(__DIR__) . '/vendor/autoload.php';
23+
require $autoloader;
24+
25+
$loop = Factory::create();
26+
$runtime = new Runtime(new FutureToPromiseConverter($loop), $autoloader);
27+
28+
$runtime->run(function () {
29+
sleep(3);
30+
31+
return 3;
32+
})->then(function (int $int): void {
33+
echo $int, PHP_EOL;
34+
});
35+
36+
$loop->run();
37+
```
38+
39+
## Contributing ##
40+
41+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
42+
43+
## License ##
44+
45+
Copyright 2019 [Cees-Jan Kiewiet](http://wyrihaximus.net/)
46+
47+
Permission is hereby granted, free of charge, to any person
48+
obtaining a copy of this software and associated documentation
49+
files (the "Software"), to deal in the Software without
50+
restriction, including without limitation the rights to use,
51+
copy, modify, merge, publish, distribute, sublicense, and/or sell
52+
copies of the Software, and to permit persons to whom the
53+
Software is furnished to do so, subject to the following
54+
conditions:
55+
56+
The above copyright notice and this permission notice shall be
57+
included in all copies or substantial portions of the Software.
58+
59+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
60+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
61+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
62+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
63+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
64+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
65+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
66+
OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)