在laravel控制器中运行异步代码

时间:2018-07-25 08:22:25

标签: laravel

是否有任何方法可以在请求控制器中异步运行多个独立功能而无需将其放入队列中?

public function exampleFunction(Request $request){

    // These are independent functions
    $one = $this->oneFunction();
    $two = $this->anotherFunction();
    $three = $this->differentFunction();

    return response()->json([
        'one'=>$one,
        'two'=> $two,
        'three'=>$three
    ]);
}

0 个答案:

没有答案