1
을 약속 나는 $result
가 준비되기 전에 전송 ReactPHP 및
$app = function ($request, $response) use ($redis, $config) {
$promise = React\Promise\all(
array(
AsyncGetUser(),
AsyncGetDB(),
AsyncGetTemplate()
)
)->then(function ($res) {
$result = ParseTemplate($user, $template, $whatever);
}
\React\Promise\resolve($promise);
$response->writeHead(200, array('Content-Type' => 'text/plain'));
$response->end($result);
}
$http->on('request', $app);
그러나 $response
ReactPHP
$promise
을 기다릴 수 있습니까?
$result
을 올바르게 보냅니 까?
$response->end
을 another->then()
섹션으로 이동하려고 시도했지만 브라우저에서 아무런 응답이 없습니다. 즉, $ app = function이 이미 완료되면 스크립트가 결과를 얻습니다.