lorisleiva / laravel-actions

⚡️ Laravel components that take care of one specific task
https://laravelactions.com
MIT License
2.51k stars 123 forks source link

Releasing a job back into the queue #109

Closed BoyeMagnus closed 3 years ago

BoyeMagnus commented 3 years ago

When handling an action as a job is it then possible to manually release it back onto the queue? Normally in Laravel jobs you're able to run $this->release(10); inside of the handle function to release the current job back onto the queue. More about Manually releasing a job: https://laravel.com/docs/8.x/queues#manually-releasing-a-job

I've tried to implement InteractsWithQueue and Queueable. However I don't seem to be able to reach the actual job instance.

I can't seem to find anything about this functionality in the docs either

lorisleiva commented 3 years ago

Hi there 👋

Laravel action will provide the Batch instance or the JobDecorator instance if they are type-hinted properly as the first argument of the asJob method.

See the relevant section of the documentation here: https://laravelactions.com/2.x/dispatch-jobs.html#batching-jobs.