-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
6,119 additions
and
1,550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flow\Examples\Data; | ||
|
||
readonly class DataA | ||
{ | ||
public function __construct(public int $id, public int $a, public int $b, public int $c) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flow\Examples\Data; | ||
|
||
readonly class DataB | ||
{ | ||
public function __construct(public int $id, public int $d, public int $e) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flow\Examples\Data; | ||
|
||
readonly class DataC | ||
{ | ||
public function __construct(public int $id, public int $f) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flow\Examples\Data; | ||
|
||
readonly class DataD | ||
{ | ||
public function __construct(public int $id) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
use Flow\Driver\AmpDriver; | ||
use Flow\Driver\FiberDriver; | ||
use Flow\Driver\ReactDriver; | ||
use Flow\Driver\RevoltDriver; | ||
use Flow\Driver\SpatieDriver; | ||
use Flow\Driver\SwooleDriver; | ||
use Flow\Examples\Transport\DoctrineIpTransport; | ||
|
@@ -21,7 +20,6 @@ | |
1 => new AmpDriver(), | ||
2 => new FiberDriver(), | ||
3 => new ReactDriver(), | ||
4 => new RevoltDriver(), | ||
5 => new SpatieDriver(), | ||
6 => new SwooleDriver(), | ||
}; | ||
|
@@ -67,10 +65,11 @@ | |
$ip->data->offsetSet('number', null); | ||
}; | ||
|
||
$flow = (new Flow($addOneJob, $errorJob, new MaxIpStrategy(1), $driver)) | ||
->fn(new Flow($multbyTwoJob, $errorJob, new MaxIpStrategy(3), $driver)) | ||
->fn(new Flow($minusThreeJob, $errorJob, new MaxIpStrategy(2), $driver)) | ||
; | ||
$flow = Flow::do(static function () use ($addOneJob, $multbyTwoJob, $minusThreeJob, $errorJob) { | ||
yield [$addOneJob, $errorJob, new MaxIpStrategy(1)]; | ||
yield [$multbyTwoJob, $errorJob, new MaxIpStrategy(3)]; | ||
yield [$minusThreeJob, $errorJob, new MaxIpStrategy(2)]; | ||
}, ['driver' => $driver]); | ||
|
||
$connection = DriverManager::getConnection(['url' => 'mysql://flow:[email protected]:3306/flow?serverVersion=8.1']); | ||
$transport = new DoctrineIpTransport($connection); | ||
|
Oops, something went wrong.