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:
parent
8fcac74f86
commit
86873515ae
4 changed files with 46 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue