LaravelPackages.net
Acme Inc.
Toggle sidebar
justiversen/laravel-job-chainer

Chain Laravel jobs without having to glue it to a starting job

52.021
72
v2.0.0
About justiversen/laravel-job-chainer

justiversen/laravel-job-chainer is a Laravel package for chain laravel jobs without having to glue it to a starting job. It currently has 72 GitHub stars and 52.021 downloads on Packagist (latest version v2.0.0). Install it with composer require justiversen/laravel-job-chainer. Discover more Laravel packages by justiversen or browse all Laravel packages to compare alternatives.

Last updated

Packagist Downloads Code size Build Status

Laravel Job Chainer

JobChainer does chain a variable amount of jobs by adding them with the add() method.

This makes it possible to chain jobs without having to know which job will be the first to be fired.

Normal job chaining

ProcessPodcast::withChain([
    new OptimizePodcast,
    new ReleasePodcast($argA, $argB)
])->dispatch($arg1);

With Job Chainer

$chain = new JobChainer;

$chain->add(ProcessPodcast::class, $arg1);
$chain->add(OptimizePodcast::class);
$chain->add(ReleasePodcast::class, $argA, $argB);

$chain->dispatch();

Why?

This allows us to add jobs to the chain without prior knowledge about which job would be the first. This may come in handy when jobs must be chained, but they are added dynamically to the chain.

Issue

Please open a new issue, if you are experiencing any troubles.

Star History Chart