Amp\Mysql\ResultSet::genericFetchAll PHP Method

genericFetchAll() protected method

protected genericFetchAll ( $cb )
    protected function genericFetchAll($cb)
    {
        if ($this->result->state == ResultProxy::ROWS_FETCHED) {
            return new Success($cb($this->result->rows));
        } else {
            $deferred = new Deferred();
            $this->result->deferreds[ResultProxy::ROWS_FETCHED][] = [$deferred, &$this->result->rows, $cb];
            return $deferred->promise();
        }
    }