Laravel http request: Cannot run multiple request

2019-04-10 14:00发布

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:

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条回答
贪生不怕死
2楼-- · 2019-04-10 14:50

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

查看更多
登录 后发表回答