summaryrefslogtreecommitdiff
path: root/tests/temporal/Workflow/SignalChildViaStubWorkflow.php
blob: 828086fcd1a71b1daa5ea63057f5fa215d11a812 (plain)
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
<?php

namespace Temporal\Tests\Workflow;

use Temporal\Workflow;
use Temporal\Workflow\WorkflowMethod;

#[Workflow\WorkflowInterface]
class SignalChildViaStubWorkflow
{
    #[WorkflowMethod(name: 'SignalChildViaStubWorkflow')]
    public function handler()
    {
        // typed stub
        $simple = Workflow::newChildWorkflowStub(SimpleSignalledWorkflow::class);

        // start execution
        $call = $simple->handler();

        yield $simple->add(8);

        // expects 8
        return yield $call;
    }
}