2727use Temporal \Internal \Transport \Request \ContinueAsNew ;
2828use Temporal \Internal \Transport \Request \GetVersion ;
2929use Temporal \Internal \Transport \Request \NewTimer ;
30+ use Temporal \Internal \Transport \Request \Panic ;
3031use Temporal \Internal \Transport \Request \SideEffect ;
3132use Temporal \Promise ;
3233use Temporal \Worker \Transport \Command \RequestInterface ;
@@ -57,11 +58,11 @@ class WorkflowContext implements WorkflowContextInterface
5758
5859 /**
5960 * WorkflowContext constructor.
60- * @param ServiceContainer $services
61- * @param ClientInterface $client
61+ * @param ServiceContainer $services
62+ * @param ClientInterface $client
6263 * @param WorkflowInstanceInterface $workflowInstance
63- * @param Input $input
64- * @param ValuesInterface|null $lastCompletionResult
64+ * @param Input $input
65+ * @param ValuesInterface|null $lastCompletionResult
6566 */
6667 public function __construct (
6768 ServiceContainer $ services ,
@@ -221,9 +222,15 @@ public function complete(array $result = null, \Throwable $failure = null): Prom
221222 $ values = EncodedValues::empty ();
222223 }
223224
224- return $ this ->request (
225- new CompleteWorkflow ($ values , $ failure )
226- );
225+ return $ this ->request (new CompleteWorkflow ($ values , $ failure ), false );
226+ }
227+
228+ /**
229+ * {@inheritDoc}
230+ */
231+ public function panic (\Throwable $ failure = null ): PromiseInterface
232+ {
233+ return $ this ->request (new Panic ($ failure ), false );
227234 }
228235
229236 /**
@@ -243,7 +250,7 @@ public function continueAsNew(
243250 );
244251
245252 // must not be captured
246- return $ this ->request ($ request );
253+ return $ this ->request ($ request, false );
247254 }
248255
249256 /**
@@ -276,8 +283,7 @@ public function executeChildWorkflow(
276283 $ returnType = null
277284 ): PromiseInterface {
278285 return $ this ->newUntypedChildWorkflowStub ($ type , $ options )
279- ->execute ($ args , $ returnType )
280- ;
286+ ->execute ($ args , $ returnType );
281287 }
282288
283289 /**
@@ -377,7 +383,7 @@ public function timer($interval): PromiseInterface
377383 /**
378384 * {@inheritDoc}
379385 */
380- public function request (RequestInterface $ request ): PromiseInterface
386+ public function request (RequestInterface $ request, bool $ cancellable = true ): PromiseInterface
381387 {
382388 $ this ->recordTrace ();
383389 return $ this ->client ->request ($ request );
@@ -426,8 +432,7 @@ public function awaitWithTimeout($interval, ...$conditions): PromiseInterface
426432 $ conditions [] = $ timer ;
427433
428434 return $ this ->await (...$ conditions )
429- ->then (static fn (): bool => !$ timer ->isComplete ())
430- ;
435+ ->then (static fn (): bool => !$ timer ->isComplete ());
431436 }
432437
433438 /**
0 commit comments