master

laravel/framework

Last updated at: 29/12/2023 09:24

JobPopped.php

TLDR

The JobPopped.php file contains the definition of the JobPopped class. This class represents an event that is fired when a job is popped from the queue. The event contains information about the connection name and the job instance that was popped.

Classes

JobPopped

The JobPopped class is an event class that represents the event when a job is popped from the queue. It has the following properties:

  • $connectionName: The name of the connection from where the job was popped.
  • $job: The job instance that was popped from the queue. It is an instance of the Illuminate\Contracts\Queue\Job interface or null if the job couldn't be retrieved.

The class has a constructor that accepts the $connectionName and $job parameters and initializes the corresponding properties.

<?php

namespace Illuminate\Queue\Events;

class JobPopped
{
    /**
     * The connection name.
     *
     * @var string
     */
    public $connectionName;

    /**
     * The job instance.
     *
     * @var \Illuminate\Contracts\Queue\Job|null
     */
    public $job;

    /**
     * Create a new event instance.
     *
     * @param  string  $connectionName
     * @param  \Illuminate\Contracts\Queue\Job|null  $job
     * @return void
     */
    public function __construct($connectionName, $job)
    {
        $this->connectionName = $connectionName;
        $this->job = $job;
    }
}