athomas's avatar

How to make Lumen 6.x jobs async

I have a controller method that's dispatching a job, and afterwards is supposed to just confirm that the job has been dispatched. Job runs in the background, all is well. In the controller it's basically doing:

public function xxx()
{
    dispatch(new Job());
    return 'confirmation that job is dispatched';
}

The issue I'm having is that the job is being run synchronously - so it's taking 2-3 minutes to respond on a long call. Everything in the documentation suggests that in Lumen/Laravel jobs are run async (and I know they have on previous Laravel applications). Has anyone encountered this before? Thanks!

0 likes
1 reply
athomas's avatar
athomas
OP
Best Answer
Level 1

Nevermind, QUEUE_CONNECTION needed to be set in the .env

Please or to participate in this conversation.