-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathWorkflowClientCallsInterceptor.php
106 lines (92 loc) · 3.44 KB
/
WorkflowClientCallsInterceptor.php
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?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\Interceptor;
use Temporal\Client\Update\UpdateHandle;
use Temporal\Client\Workflow\WorkflowExecutionDescription;
use Temporal\DataConverter\ValuesInterface;
use Temporal\Interceptor\Trait\WorkflowClientCallsInterceptorTrait;
use Temporal\Interceptor\WorkflowClient\CancelInput;
use Temporal\Interceptor\WorkflowClient\DescribeInput;
use Temporal\Interceptor\WorkflowClient\GetResultInput;
use Temporal\Interceptor\WorkflowClient\QueryInput;
use Temporal\Interceptor\WorkflowClient\SignalInput;
use Temporal\Interceptor\WorkflowClient\SignalWithStartInput;
use Temporal\Interceptor\WorkflowClient\StartInput;
use Temporal\Interceptor\WorkflowClient\StartUpdateOutput;
use Temporal\Interceptor\WorkflowClient\TerminateInput;
use Temporal\Interceptor\WorkflowClient\UpdateInput;
use Temporal\Interceptor\WorkflowClient\UpdateWithStartInput;
use Temporal\Internal\Interceptor\Interceptor;
use Temporal\Workflow\WorkflowExecution;
/**
* It's recommended to use `WorkflowClientCallsInterceptorTrait` when implementing this interface because
* the interface might be extended in the future. The trait will provide forward compatibility.
*
* ```php
* class MyWorkflowClientCallsInterceptor implements WorkflowClientCallsInterceptor
* {
* use WorkflowClientCallsInterceptorTrait;
*
* public function start(StartInput $input, callable $next): WorkflowExecution
* {
* error_log('Starting workflow: ' . $input->workflowType);
*
* return $next($input);
* }
* }
* ```
*
* @see WorkflowClientCallsInterceptorTrait
*/
interface WorkflowClientCallsInterceptor extends Interceptor
{
/**
* @param callable(StartInput): WorkflowExecution $next
*/
public function start(StartInput $input, callable $next): WorkflowExecution;
/**
* @param callable(SignalInput): void $next
*/
public function signal(SignalInput $input, callable $next): void;
/**
* @param callable(UpdateInput): StartUpdateOutput $next
*/
public function update(UpdateInput $input, callable $next): StartUpdateOutput;
/**
* @param callable(SignalWithStartInput): WorkflowExecution $next
*/
public function signalWithStart(SignalWithStartInput $input, callable $next): WorkflowExecution;
/**
* @param UpdateWithStartInput $input
* @param callable(UpdateWithStartInput): WorkflowExecution $next
*
* @return UpdateHandle
*/
public function updateWithStart(UpdateWithStartInput $input, callable $next): UpdateHandle;
/**
* @param callable(GetResultInput): ?ValuesInterface $next
*/
public function getResult(GetResultInput $input, callable $next): ?ValuesInterface;
/**
* @param callable(QueryInput): ?ValuesInterface $next
*/
public function query(QueryInput $input, callable $next): ?ValuesInterface;
/**
* @param callable(CancelInput): void $next
*/
public function cancel(CancelInput $input, callable $next): void;
/**
* @param callable(TerminateInput): void $next
*/
public function terminate(TerminateInput $input, callable $next): void;
/**
* @param callable(DescribeInput): void $next
*/
public function describe(DescribeInput $input, callable $next): WorkflowExecutionDescription;
}