ZetecVan's avatar

Using Jobs In Lumen

I'm trying to migrate some queue code from Laravel 5 to Lumen. I am getting the 'No handler registered for command [App\Jobs\SaveProduct]' error message. Reading through the Lumen documentation, there's no mention of having to register the handler, and you can't run php artisan make:command as it doesn't exist.

Does anyone have a good code example of how to create jobs in Lumen so I can see what I've not done? Cheers

0 likes
3 replies
ZetecVan's avatar

I realised Jeffrey posted a new video yesterday showing how to set up jobs in Laravel 5.1. Following that I managed to fix the problem.

mhague-rmn's avatar

The error I made was not implementing SelfHandling when extending the job class.

I now have:

class MyJob extends Job implements SelfHandling

CrtlAltDylan's avatar

I also noticed that jobs aren't syncronous. You need to run php artisan queue:work to see results.

Please or to participate in this conversation.