From 43071e43a0743ff8c7913bba7819952962124355 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Mon, 25 Jan 2021 22:47:02 +0300 Subject: Initial commit of the Temporal plugins set --- tests/temporal/Activity/SimpleActivity.php | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 tests/temporal/Activity/SimpleActivity.php (limited to 'tests/temporal/Activity/SimpleActivity.php') diff --git a/tests/temporal/Activity/SimpleActivity.php b/tests/temporal/Activity/SimpleActivity.php new file mode 100644 index 00000000..576b126e --- /dev/null +++ b/tests/temporal/Activity/SimpleActivity.php @@ -0,0 +1,63 @@ +", $user->name, $user->email)); + } + + #[ActivityMethod] + public function slow( + string $input + ): string { + sleep(2); + + return strtolower($input); + } + + #[ActivityMethod] + public function sha512( + Bytes $input + ): string { + return hash("sha512", ($input->getData())); + } + + public function updateRunID(WorkflowExecution $e): WorkflowExecution + { + $e->setRunId('updated'); + return $e; + } + + #[ActivityMethod] + public function fail() + { + throw new \Error("failed activity"); + } +} \ No newline at end of file -- cgit v1.2.3