About how to use laravel queues for asynchronous no-delay execution

you need to use laravel queues (redis drivers) to implement code execution asynchronously without delay, such as

$stock = 5;
$job = new DecStock ();
$this- > dispatch ($job);

return $stock;

the purpose is to return the variable $stock as soon as possible and execute a queue asynchronously for some processing

found that in DecStock job, if there is no implement IlluminateContractsQueueShouldQueue;
, it is impossible to wait for the queue execution to return $stock
asynchronously, but it can be inherited asynchronously with a delay of 1-2 seconds (probably not the time it takes to get in and out of the queue. )
how to implement queue execution without delay? Or do not use the queue, is there any other plan?

Mar.03,2021
The queue of

laravel is seconds. According to your needs, what you need is a millisecond queue. Consider swoole

  • Predis ERR unknown command 'EVAL'

    laravel version: 5.5.36 redis version: 3.06 when I refer to predis in a laravel project, I have no problem in the local windows environment, but I have a problem in the production environment. my code is as follows: public function getPhoneCode(...

    Apr.01,2021
Menu