diff options
Diffstat (limited to 'tests/temporal/Workflow/SimpleHeartbeatWorkflow.php')
-rw-r--r-- | tests/temporal/Workflow/SimpleHeartbeatWorkflow.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/temporal/Workflow/SimpleHeartbeatWorkflow.php b/tests/temporal/Workflow/SimpleHeartbeatWorkflow.php new file mode 100644 index 00000000..c9999cd1 --- /dev/null +++ b/tests/temporal/Workflow/SimpleHeartbeatWorkflow.php @@ -0,0 +1,25 @@ +<?php + +declare(strict_types=1); + +namespace Temporal\Tests\Workflow; + +use Temporal\Activity\ActivityOptions; +use Temporal\Workflow; +use Temporal\Workflow\WorkflowMethod; +use Temporal\Tests\Activity\HeartBeatActivity; + +#[Workflow\WorkflowInterface] +class SimpleHeartbeatWorkflow +{ + #[WorkflowMethod(name: 'SimpleHeartbeatWorkflow')] + public function handler(int $iterations): iterable + { + $act = Workflow::newActivityStub( + HeartBeatActivity::class, + ActivityOptions::new()->withStartToCloseTimeout(50) + ); + + return yield $act->doSomething($iterations); + } +} |