Support the ongoing development of →
Queues Architecture
Last updated 1 year ago.

To give a bit more detail, I'm building an in-house app kind of like Forge. There's a team who manage a number of contractors who aren't technically minded. The app I'm building steps them through the process of creating client websites, from start to final live deployment.

It encapsulates the creation / management of VCS repositories (, deployments ( and AWS hosted CentOS boxes.

The specific example would be, when a "website" entity is created in this app, we need to:

  1. Create a VCS repository
  2. Clone an existing, boilerplate repository and push it to the new blank VCS repository
  3. Create a deployment configuration.

If (1) or (2) fail, obviously (3) won't work because it requires an existing VCS repository...

Last updated 1 year ago.

The solution I ended up going with was to make Task (1) fire an event that could be subscribed to in order to queue Task (2), which would fire an event that could be subscribed to in order to queue Task (3), etc...

Last updated 1 year ago.

Hello, I had similiar situation, I expose my solution, it can be useful to someone:

interface StepJob

    public function nextStep();

    public function notify(); //optionally
abstract class InstallationJob extends Job implements ShouldQueue, StepJob
    protected $plan = [ 
                               Job1::class => Job2::class,
                              JobN::class => JobX::class

    function nextStep()
                  //dispatch next job based on $this->plan dependences or more complex dependences. call notify() when done.

Create and Register a EventListener (JobsEventListener.php) for events (JobProcessed,JobFailed,JobProcessing):

    public function success(JobProcessed $event)
        $job = $this->unserializeJob($event);

        Log::debug("Job Processed ".get_class($job));

        if ($job instanceof  StepJob)

success function are listening "JobProcessed" Event.

Another considerations:

Process has a model related. nextStep() method updates model taking care with concurrency(using transaction and lockForUpdate). Model is created before start the process and pas on the job constructor.

Now, I need to define another similar process , and I'm thinking about to implement something like

But I'm trying not to get too complicated.

Last updated 7 years ago.

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.