請(qǐng)教webman如何在控制器的方法return之后不主動(dòng)關(guān)閉http連接?
<?php
namespace app\controller;
use support\Request;
class FooController
{
public function hello(Request $request)
{
return response('hello webman'); // 比如我有一個(gè)異步的方法,在return之前不會(huì)立即返回?cái)?shù)據(jù)
}
}
return不會(huì)關(guān)閉連接,你可以先發(fā)一個(gè)http頭過(guò)去,然后異步發(fā)送包體。
參考 http://wtbis.cn/plugin/157