1
0
Fork 0
mirror of https://github.com/archtechx/jobpipeline.git synced 2025-12-12 14:14:04 +00:00

Allow canceling pipelines by returning false from handle()

This commit is contained in:
Samuel Štancl 2020-11-12 19:33:31 +01:00
parent 8fcac74f86
commit 86873515ae
4 changed files with 46 additions and 1 deletions

View file

@ -57,7 +57,11 @@ class JobPipeline implements ShouldQueue
public function handle(): void
{
foreach ($this->jobs as $job) {
app()->call([new $job(...$this->passable), 'handle']);
$result = app()->call([new $job(...$this->passable), 'handle']);
if ($result === false) {
break;
}
}
}