|
72 | 72 | use Temporal\Workflow\ContinueAsNewOptions; |
73 | 73 | use Temporal\Workflow\ExternalWorkflowStubInterface; |
74 | 74 | use Temporal\Workflow\Mutex; |
| 75 | +use Temporal\Workflow\TimerOptions; |
75 | 76 | use Temporal\Workflow\WorkflowContextInterface; |
76 | 77 | use Temporal\Workflow\WorkflowExecution; |
77 | 78 | use Temporal\Workflow\WorkflowInfo; |
@@ -455,15 +456,17 @@ public function newActivityStub( |
455 | 456 | ); |
456 | 457 | } |
457 | 458 |
|
458 | | - public function timer($interval): PromiseInterface |
| 459 | + public function timer($interval, ?TimerOptions $options = null): PromiseInterface |
459 | 460 | { |
460 | 461 | $dateInterval = DateInterval::parse($interval, DateInterval::FORMAT_SECONDS); |
461 | 462 |
|
462 | 463 | return $this->callsInterceptor->with( |
463 | | - fn(TimerInput $input): PromiseInterface => $this->request(new NewTimer($input->interval)), |
| 464 | + fn(TimerInput $input): PromiseInterface => $this->request( |
| 465 | + new NewTimer(new AwaitOptions($input->interval, $options)), |
| 466 | + ), |
464 | 467 | /** @see WorkflowOutboundCallsInterceptor::timer() */ |
465 | 468 | 'timer', |
466 | | - )(new TimerInput($dateInterval)); |
| 469 | + )(new TimerInput($dateInterval, $options)); |
467 | 470 | } |
468 | 471 |
|
469 | 472 | public function request( |
@@ -606,7 +609,7 @@ public function awaitWithTimeout($interval, callable|Mutex|PromiseInterface ...$ |
606 | 609 | return $this->callsInterceptor->with( |
607 | 610 | function (AwaitWithTimeoutInput $input): PromiseInterface { |
608 | 611 | /** Bypassing {@see timer()} to acquire a timer request ID */ |
609 | | - $request = new NewTimer($input->interval); |
| 612 | + $request = new NewTimer(new AwaitOptions($input->interval, null)); |
610 | 613 | $requestId = $request->getID(); |
611 | 614 | $timer = $this->request($request); |
612 | 615 | \assert($timer instanceof CompletableResultInterface); |
|
0 commit comments