Answer the question
In order to leave comments, you need to log in
Where to read normally about queues?
I'm trying for the third day to deal with queues in Laravel 5.4
I can't figure out how to work with them.
Here I created a queue file through artisan, it has 2 properties and 2 methods (constructor and handler). As I understand it, this is some kind of controller that will be twitched by the queue listener, right? When this queue handler is called, the handle() method will be called, which will perform the task.
I enter the data in the database (with which the queue will work) and I know the id of the record with which to work and the number of iterations to work with it.
How do I pass them to the queue listener (or who?) to start the queue?
Since 1 iteration = 1 call to the queue, I will need to call Queue::after() to run the queue again until the iterations are over. When the iterations run out, you need to send a message to the mail (conditionally, let there be a message to the mail that all iterations have been completed) how to do this too?
I was looking for at least a list of queue methods and their description, but I did not find it.
Answer the question
In order to leave comments, you need to log in
Create a Job with an iteration counter. Each time the task is executed, you change the counter and send it further to the queue. When the counter reaches the desired value - do what you need there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question