-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathTemporalStarter.php
More file actions
59 lines (52 loc) · 2.04 KB
/
TemporalStarter.php
File metadata and controls
59 lines (52 loc) · 2.04 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
53
54
55
56
57
58
59
<?php
declare(strict_types=1);
namespace Temporal\Tests\Acceptance\App\Runtime;
use Symfony\Component\Process\Process;
use Temporal\Common\SearchAttributes\ValueType;
use Temporal\Testing\Environment;
final class TemporalStarter
{
public function __construct(
private Environment $environment,
)
{
\register_shutdown_function(fn() => $this->stop());
}
public function start(): void
{
if ($this->environment->isTemporalRunning()) {
return;
}
$this->environment->startTemporalServer(
parameters: [
'--dynamic-config-value', 'frontend.enableUpdateWorkflowExecution=true',
'--dynamic-config-value', 'frontend.enableUpdateWorkflowExecutionAsyncAccepted=true',
'--dynamic-config-value', 'frontend.enableExecuteMultiOperation=true',
'--dynamic-config-value', 'system.enableEagerWorkflowStart=true',
'--dynamic-config-value', 'frontend.activityAPIsEnabled=true',
'--dynamic-config-value', 'frontend.workerVersioningWorkflowAPIs=true',
'--dynamic-config-value', 'system.enableDeploymentVersions=true',
'--dynamic-config-value', 'history.enableChasm=true',
'--dynamic-config-value', 'history.enableCHASMSchedulerCreation=true',
],
searchAttributes: [
'foo' => ValueType::Text->value,
'bar' => ValueType::Int->value,
'testBool' => ValueType::Bool,
'testInt' => ValueType::Int,
'testFloat' => ValueType::Float,
'testText' => ValueType::Text,
'testKeyword' => ValueType::Keyword,
'testKeywordList' => ValueType::KeywordList,
'testDatetime' => ValueType::Datetime,
],
);
}
/**
* @return bool Returns true if the server was stopped successfully, false if it was not started.
*/
public function stop(): void
{
$this->environment->stop();
}
}