Block and wait until pagelet task finishes or times out

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


  • resource $task - The pagelet task handle returned from pagelet_server_task_start().
  • inout mixed $headers - HTTP response headers.
  • inout 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.


  • string - - HTTP response from the pagelet.