Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.12 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.12 KB

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.