|
1 |
| -# streams |
2 |
| -Interthread communication using channels |
| 1 | +# Streams abstraction around ext-parallel Channels for ReactPHP |
| 2 | + |
| 3 | + |
| 4 | +[](https://packagist.org/packages/React-parallel/streams) |
| 5 | +[](https://packagist.org/packages/React-parallel/streams) |
| 6 | +[](https://scrutinizer-ci.com/g/Reactphp-parallel/streams/?branch=master) |
| 7 | +[](https://shepherd.dev/github/Reactphp-parallel/streams) |
| 8 | +[](https://packagist.org/packages/React-parallel/streams) |
| 9 | + |
| 10 | +### Installation ### |
| 11 | + |
| 12 | +To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`. |
| 13 | + |
| 14 | +``` |
| 15 | +composer require react-parallel/streams |
| 16 | +``` |
| 17 | + |
| 18 | +# Usage |
| 19 | + |
| 20 | +This package currently only offers channel to observable conversion through two methods: |
| 21 | + |
| 22 | +```php |
| 23 | +$loop = EventLoopFactory::create(); |
| 24 | +$eventLoopBridge = new EventLoopBridge($loop); |
| 25 | +$factory = new Factory($eventLoopBridge); |
| 26 | +$factory->channel($channel); // Returns an observble that will continue until the channel closes |
| 27 | +$factory->single($channel); // Returns a promise that will resolve with the first message it receives |
| 28 | +``` |
| 29 | + |
| 30 | +## Contributing ## |
| 31 | + |
| 32 | +Please see [CONTRIBUTING](CONTRIBUTING.md) for details. |
| 33 | + |
| 34 | +## License ## |
| 35 | + |
| 36 | +Copyright 2020 [Cees-Jan Kiewiet](http://wyrihaximus.net/) |
| 37 | + |
| 38 | +Permission is hereby granted, free of charge, to any person |
| 39 | +obtaining a copy of this software and associated documentation |
| 40 | +files (the "Software"), to deal in the Software without |
| 41 | +restriction, including without limitation the rights to use, |
| 42 | +copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 43 | +copies of the Software, and to permit persons to whom the |
| 44 | +Software is furnished to do so, subject to the following |
| 45 | +conditions: |
| 46 | + |
| 47 | +The above copyright notice and this permission notice shall be |
| 48 | +included in all copies or substantial portions of the Software. |
| 49 | + |
| 50 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 51 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 52 | +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 53 | +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 54 | +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 55 | +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 56 | +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 57 | +OTHER DEALINGS IN THE SOFTWARE. |
0 commit comments