Illuminate\Queue\Console\WorkCommand::listenForEvents PHP Method

listenForEvents() protected method

Listen for the queue events in order to update the console output.
protected listenForEvents ( ) : void
return void
    protected function listenForEvents()
    {
        $this->laravel['events']->listen(JobProcessed::class, function ($event) {
            $this->writeOutput($event->job, false);
        });
        $this->laravel['events']->listen(JobFailed::class, function ($event) {
            $this->writeOutput($event->job, true);
            $this->logFailedJob($event);
        });
    }