• Reading time ~ 1 min
  • 24.08.2022

Laravel Job Chainer is a package to chain Laravel jobs without having to glue them together with a starting job. Job Chainer makes it possible to dynamically chain jobs using the provided JobChainer class:

// Typical 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();

This package makes it convenient to dynamically add jobs without prior knowledge about which job should be first. One use-case could be if you wanted to provide a UI for users to have the ability to customize which jobs steps should run (or not run) for a given job pipeline.

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

For further reading on job chaining, check out Laravel's queue job chaining documentation.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297