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

Source: Internet
Author: User
After laravel uses a queue, how does the front end receive the completion prompt? after laravel uses a queue, how does the front end receive the completion prompt?

Reply content:

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

Using the queue means that the request is executed asynchronously. you certainly cannot directly obtain the result of the frontend request. put the request content in the queue and the request ends. The rest is processed asynchronously.

Since no results are available, you can only give front-end friendly prompts.
For example, "Your request is being processed, please wait patiently" (do not tangle with statements)

The queue is asynchronously executed, and the result cannot be obtained directly.
If you want to use a queue. Also want to request. Persistent connections are supported.

Front end

For example, when an operation is initiated and added to the queue, a row of data (the data in the current queue) is usually generated at this time, and then a field is in the status; after joining the queue, a callback identifier (suchJobid); If the queue processing performance is excellent, the front-end can directly use ajax to check whether the status of the job is changed. if the status of the job is changed, the result is returned.

Backend asynchronous queue processing

After the team is included in the stack, the backend processes the queue, processes the logic according to the specified method, and writes the returned value to the corresponding job callback value!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.