Home > Backend Development > PHP Tutorial > After laravel uses the queue, how does the front end receive the completion prompt?

After laravel uses the queue, how does the front end receive the completion prompt?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-06 13:52:29
Original
1355 people have browsed it

After laravel uses queues, how does the front end receive a completion prompt

Reply content:

After laravel uses queues, how does the front end receive a completion prompt

<code>使用队列就意味着是异步执行的,肯定不能直接得到结果
前端请求过来,把请求内容放到队列,请求结束,剩下的是异步处理的</code>
Copy after login

Since I can’t get the result, I can only give the front end some friendly tips
Such as "Your request is being processed, please wait patiently" (don’t get hung up on the sentence)

What you said above is correct. Queues are executed asynchronously, and the results cannot be obtained directly.
If you want to use queues. I still want to request. You can use long connections.

Front end

For example, if you initiate an operation and join the queue, a row of data (data of the current queue) will generally be generated at this time, and then there will be a field for status; after joining the queue, there will be a callback identifier (such as jobid) ; If the queue processing performance is excellent, the front end can directly use ajax to poll whether the status of the job has changed. If it changes, the result will be returned

Background asynchronous queue processing

After the queue is added to the stack, the queue is processed in the background, the relevant logic is processed according to the specified method, and the return value is written into the corresponding job callback value!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template