Skip to content
Discussion options

You must be logged in to vote

@Braindea7

Without the cancellation activity, the message contained in the first check on $this->cancellation is always thrown. But I think that's just how signals work?

Ah, I see the problem now.

You have to wrap the check in a sideEffect.

if (yield sideEffect(fn (): bool => $this->cancelled)) {
    throw new RuntimeException('Workflow cancelled by signal.');
}
laravel@65b26dbfc34a:/var/www/html$ php artisan queue:work

   INFO  Processing jobs from the [default] queue.  

  2026-02-20 15:07:21 App\Workflows\Cancel\GetAdReportWorkflow ....................................... RUNNING
  2026-02-20 15:07:22 App\Workflows\Cancel\GetAdReportWorkflow ....................................... 1s…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@Braindea7
Comment options

@Braindea7
Comment options

@Braindea7
Comment options

@rmcdaniel
Comment options

Answer selected by Braindea7
@Braindea7
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants