Created
April 25, 2023 12:54
-
-
Save rmcdaniel/1e8df16dc1b3a71202fc677d9ab4bee0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
namespace App\Workflows\Database; | |
use Workflow\Activity; | |
class DatabaseActivity extends Activity | |
{ | |
public function execute() | |
{ | |
return [ | |
SimpleActivity::class, | |
SimpleActivity::class, | |
SimpleActivity::class, | |
]; | |
} | |
} |
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
namespace App\Workflows\Database; | |
use Workflow\ActivityStub; | |
use Workflow\Workflow; | |
class DatabaseWorkflow extends Workflow | |
{ | |
public function execute() | |
{ | |
$activities = yield ActivityStub::make(DatabaseActivity::class); | |
foreach ($activities as $activity) { | |
yield ActivityStub::make($activity); | |
} | |
} | |
} |
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
namespace App\Workflows\Database; | |
use Workflow\Activity; | |
class SimpleActivity extends Activity | |
{ | |
public function execute() | |
{ | |
return 'activity'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment