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!