I want my APIS made with DINGO can run ASYNC. Currently, my api is sync because when i try to request an API with sleep command and then I call another api, the second api just return value when firt request is passed over the sleep time. This is the code I used to test:
First api route:
public function checkLongRunning(Request $request){
$data = $request->all();
if($data['check'] == 1){
sleep(5);
return response()->json(['error' => 'slept in 5 secs'], 500);
}else{
return response()->json(['error' => 'bad request'], 500);
}
}
Second api route:
public function checkLongRunning2(Request $request){
$data = $request->all();
if($data['check'] == 1){
return response()->json(['error' => 'OK'], 500);
}else{
return response()->json(['error' => 'asd'], 500);
}
}
Is there anyway I can make my API (build with DINGO in Laravel 5.4) run ASYNC (can request another api when first api request are sleeping)?
Thank you.