-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathWorkflowRunInterface.php
More file actions
52 lines (45 loc) · 1.46 KB
/
WorkflowRunInterface.php
File metadata and controls
52 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* This file is part of Temporal package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Temporal\Workflow;
use Temporal\Client\Workflow\WorkflowExecutionDescription;
use Temporal\DataConverter\Type;
use Temporal\Exception\Client\WorkflowFailedException;
/**
* Represents a running workflow execution. Can be used to wait for the completion result or error.
* @template ReturnType
*/
interface WorkflowRunInterface
{
/**
* Returns attached workflow execution.
*/
public function getExecution(): WorkflowExecution;
/**
* Returns workflow result potentially waiting for workflow to complete.
* Behind the scene this call performs long poll on Temporal service waiting
* for workflow completion notification.
*
* ```php
* // Map to array
* $result = $run->getResult(Type::TYPE_ARRAY);
*
* // Map to list of custom class
* $result = $run->getResult(Type::arrayOf(Message::class));
* ```
*
* @param string|\ReflectionClass|\ReflectionType|Type|null $type
* @param int|null $timeout Timeout in seconds. Infinite by the default.
* @throws WorkflowFailedException
* @return ReturnType
*
* @see DateInterval
*/
public function getResult($type = null, ?int $timeout = null): mixed;
public function describe(): WorkflowExecutionDescription;
}