Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/darkwood-com/flow
💧Flow
https://github.com/darkwood-com/flow
amphp async fiber monad php reactphp spatie swoole symfony
Last synced: 3 months ago
JSON representation
💧Flow
- Host: GitHub
- URL: https://github.com/darkwood-com/flow
- Owner: darkwood-com
- License: mit
- Created: 2021-04-06T13:39:16.000Z (almost 4 years ago)
- Default Branch: 1.x
- Last Pushed: 2024-10-27T12:51:30.000Z (3 months ago)
- Last Synced: 2024-10-27T14:22:00.308Z (3 months ago)
- Topics: amphp, async, fiber, monad, php, reactphp, spatie, swoole, symfony
- Language: PHP
- Homepage: http://flow.darkwood.com
- Size: 6.82 MB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Why ?
Flow concept aims to solve
- Adopt asynchronous as native implementation
- Build your code with functional programming
- Assemble your code visually## Installation
PHP 8.3 is the minimal version to use Flow
The recommended way to install it through [Composer](http://getcomposer.org) and execute```bash
composer require darkwood/flow
```## Usage
```php
new D2($data1->n1 += 1);
yield fn (D2 $data2) => new D3($data2->n2 * 2);
yield function(D3 $data3) {
printf("my number %d\n", $ip->data->n3)); // display 'my number 10'return new D4($data3->n3);
};
});$ip = new Ip(new D1(4));
$flow($ip);
$flow->await();
```## Examples
A working script is available in the bundled `examples` directory
- Run Flow : `php examples/flow.php`
- Run Y-Combinator Flow : `php examples/yflow.php`
- Start Server : `php examples/server.php`
Start Client(s) : `php examples/client.php`## Documentation
[https://darkwood-com.github.io/flow](https://darkwood-com.github.io/flow)
## License
Flow is released under the MIT License.