Laravel http request: Cannot run multiple request

徘徊边缘 提交于 2020-01-01 12:08:42

问题


I got terrible problem with Laravel http request. Please help me to solve this:

I assumed that I have 2 requests that route to same Controller:

  • Req 1: http://localhost:8000/manualScheduler/runScript?task_name=Task (This request takes much time to run around 2mins)

  • Req 2:http://localhost:8000/manualScheduler/detail?task_name=Task ( this one is very quick)

When I fired Req 1 then next is Req 2. I just think that 2 Reqs are separately, means Req 1 and Req 2 run in their own way. But the result I got was Req 2 could not finish when Req 1 was running.

In controller,

  • Req 1: I want to run script to parse HTML file with yangqi/htmldom
  • Req 2: I want to return some simple value.

Edited: My question is why my Req 2 has to wait Req 1 finish first? They should not depend on each other, i think? Or some problem with Laravel.

Thanks for your support,


回答1:


Looks like you are using default local synchronous queue driver. To get parallel processing capability you need to use some other driver. I recommend iron.io

More info from http://laravel.com/docs/5.0/queues#configuration



来源:https://stackoverflow.com/questions/29790713/laravel-http-request-cannot-run-multiple-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!