Skip to content

Commit 724b2e6

Browse files
authored
Merge pull request #68 from reactphp-parallel/3.x-add-examples
Add example
2 parents da387cb + 6a168e9 commit 724b2e6

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Cees-Jan Kiewiet
3+
Copyright (c) 2025 Cees-Jan Kiewiet
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`.
1313

1414
```
15-
composer require react-parallel/runtime
15+
composer require react-parallel/runtime
1616
```
1717

1818
# Usage
@@ -36,7 +36,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
3636

3737
## License ##
3838

39-
Copyright 2019 [Cees-Jan Kiewiet](http://wyrihaximus.net/)
39+
Copyright 2025 [Cees-Jan Kiewiet](http://wyrihaximus.net/)
4040

4141
Permission is hereby granted, free of charge, to any person
4242
obtaining a copy of this software and associated documentation

examples/run.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
use ReactParallel\Runtime\Runtime;
4+
use ReactParallel\EventLoop\EventLoopBridge;
5+
6+
require __DIR__ . '/../vendor/autoload.php';
7+
8+
$runtime = Runtime::create(new EventLoopBridge());
9+
10+
echo $runtime->run(function (): int {
11+
sleep(3);
12+
13+
return 3;
14+
}), PHP_EOL;

0 commit comments

Comments
 (0)