diff options
Diffstat (limited to 'tests/temporal/Activity/HeartBeatActivity.php')
-rw-r--r-- | tests/temporal/Activity/HeartBeatActivity.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/temporal/Activity/HeartBeatActivity.php b/tests/temporal/Activity/HeartBeatActivity.php deleted file mode 100644 index acf4a451..00000000 --- a/tests/temporal/Activity/HeartBeatActivity.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace Temporal\Tests\Activity; - -use Temporal\Activity; -use Temporal\Activity\ActivityInterface; -use Temporal\Activity\ActivityMethod; -use Temporal\Roadrunner\Internal\Error; - -#[ActivityInterface(prefix: "HeartBeatActivity.")] -class HeartBeatActivity -{ - #[ActivityMethod] - public function doSomething( - int $value - ): string { - Activity::heartbeat(['value' => $value]); - sleep($value); - return 'OK'; - } - - #[ActivityMethod] - public function slow( - string $value - ): string { - for ($i = 0; $i < 5; $i++) { - Activity::heartbeat(['value' => $i]); - sleep(1); - } - - return 'OK'; - } - - #[ActivityMethod] - public function something( - string $value - ): string { - Activity::heartbeat(['value' => $value]); - sleep($value); - return 'OK'; - } - - #[ActivityMethod] - public function failedActivity( - int $value - ): string { - Activity::heartbeat(['value' => $value]); - if (Activity::getInfo()->attempt === 1) { - throw new \Error("failed"); - } - - if (!is_array(Activity::getHeartbeatDetails())) { - throw new \Error("no heartbeat details"); - } - - return 'OK!'; - } -}
\ No newline at end of file |