P
P
Pavel2017-01-05 13:54:08
Redis
Pavel, 2017-01-05 13:54:08

How to organize parallel execution of tasks with redis in laravel?

You need to run parallel tasks in the background. Each task takes several hours to complete.
For this, as I understand it, laravel uses queues, but each task is executed in turn, and I need to run them in parallel. How can you run the next task in the background without waiting for one task to complete? Maybe I'm not digging there at all and I need to use something else for this?
Tasks are started like this:

$job = (new \App\Jobs\name_task($params))->delay(1);
            dispatch($job);

This is how I listen:
php artisan queue:listen redis --timeout=0

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eugene, 2017-01-05
@BoRzZoY

run multiple queues

A
Alexander Evgenievich, 2017-01-05
@banderos120

Something about threads: https://habrahabr.ru/post/300952/
Something about processes: www.phphighload.com/2012/07/pcntl.html

D
Dmitry Tallmange, 2017-06-16
@p00h

curl -L https://fl.ru

D
Dimonchik, 2017-06-16
@dimonchik2013

chrome f12

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question