Block and wait until pagelet task finishes or times out


function pagelet_server_task_result(
  resource $task,
  mixed &$headers,
  mixed &$code,
  int $timeout_ms = 0,
): string


  • resource$task - The pagelet task handle returned from pagelet_server_task_start().
  • mixed&$headers - HTTP response headers.
  • mixed&$code - HTTP response code. Set to -1 in the event of a timeout.
  • int$timeout_ms = 0 - How many milliseconds to wait. A timeout of zero is interpreted as an infinite timeout.

Return Values

  • string - - HTTP response from the pagelet.