Hello! laravel you please laravel me how to set up queues in laravel ? If it is easy to brief instructions ...
The fact is that now the queues are executed immediately, without any delay, and I need to complete in three / five minutes.
Queues for this purpose are created that would be executed in turn and instantly if the queue is not empty.
The only way in this case, inside the task, at the very beginning is to put sleep (the number of seconds).
The task will be executed with a delay and while it is working, the next one will not start.
From here for 5.2: https://laravel.com/docs/5.1/queues#delayed-jobs
you may wish to request a customer a reminder e-mail 15 minutes after sign-up. You can accomplish this using your Illuminate \ Bus \ Queueable trait:
<?php namespace App\Http\Controllers; use App\User; use Illuminate\Http\Request; use App\Jobs\SendReminderEmail; use App\Http\Controllers\Controller; class UserController extends Controller { /** * Send a reminder e-mail to a given user. * * @param Request $request * @param int $id * @return Response */ public function sendReminderEmail(Request $request, $id) { $user = User::findOrFail($id); $job = (new SendReminderEmail($user))->delay(60); Source: https://ru.stackoverflow.com/questions/335736/
All Articles