Page MenuHomeClusterLabs Projects

final class QueryFuture
Phorge Technical Documentation (Storage)

This class provides several approaches for querying data from the database:

  1. Async queries: Used under MySQLi with MySQLnd.
  2. Parallel queries: Used under HPHP.
  3. Multi queries: Used under MySQLi or HPHP.
  4. Single queries: Used under MySQL.

The class automatically decides which approach to use. Usage is like with other futures:

$futures = array();
$futures[] = new QueryFuture($conn1, 'SELECT 1');
$futures[] = new QueryFuture($conn1, 'DELETE FROM table');
$futures[] = new QueryFuture($conn2, 'SELECT 2');

foreach (new FutureIterator($futures) as $future) {
  try {
    $result = $future->resolve();
  } catch (AphrontQueryException $ex) {
  }
}

$result contains a list of dicts for select queries or number of modified rows for modification queries.

Methods

public function __construct($conn, $pattern)

This method is not documented.
Parameters
AphrontDatabaseConnection$conn
$pattern
Return
this//Implicit.//

public function isReady()

This method is not documented.
Return
wild

private function processResults($results)

This method is not documented.
Parameters
array$results
Return
wild