public function getDelayed($keys, $with_cas=false, $value_cb=null) {
    // Clear any previous delayed results.
    $this->delayed_results = array();

    $cas_tokens = null;
    if ($with_cas) {
      $results = $this->getMulti($keys, $cas_tokens);
    } else {
      $results = $this->getMulti($keys);
    }

    if (!$results) {
      return false;
    }

    foreach($results as $key => $value) {
      $val = ['key' => $key, 'value' => $value];
      if (!empty($cas_tokens)) {
        $cas = array_shift($cas_tokens);
        $val['cas'] = $cas;
      }
      $this->delayed_results[] = $val;
    }

    if (isset($value_cb)) {
      foreach($this->delayed_results as $result) {
        $value_cb($result);
      }
    }

    return true;
  }
public function getDelayed($keys, $with_cas=false, $value_cb=null) {
    // Clear any previous delayed results.
    $this->delayed_results = array();

    $cas_tokens = null;
    if ($with_cas) {
      $results = $this->getMulti($keys, $cas_tokens);
    } else {
      $results = $this->getMulti($keys);
    }

    if (!$results) {
      return false;
    }

    foreach($results as $key => $value) {
      $val = ['key' => $key, 'value' => $value];
      if (!empty($cas_tokens)) {
        $cas = array_shift($cas_tokens);
        $val['cas'] = $cas;
      }
      $this->delayed_results[] = $val;
    }

    if (isset($value_cb)) {
      foreach($this->delayed_results as $result) {
        $value_cb($result);
      }
    }

    return true;
  }
public function getDelayed ( $ keys , $ with_cas = false , $ value_cb = null ) { // Clear any previous delayed results. $ this -> delayed_results = array ( ) ; $ cas_tokens = null ; if ( $ with_cas ) { $ results = $ this -> getMulti ( $ keys , $ cas_tokens ) ; } else { $ results = $ this -> getMulti ( $ keys ) ; } if ( ! $ results ) { return false ; } foreach ( $ results as $ key => $ value ) { $ val = [ 'key' => $ key , 'value' => $ value ] ; if ( ! empty ( $ cas_tokens ) ) { $ cas = array_shift ( $ cas_tokens ) ; $ val [ 'cas' ] = $ cas ; } $ this -> delayed_results [ ] = $ val ; } if ( isset ( $ value_cb ) ) { foreach ( $ this -> delayed_results as $ result ) { $ value_cb ( $ result ) ; } } return true ; }
Issues a request to memcache for multiple items the keys of which are
specified in the keys array.
Currently this method executes synchronously.

@param array $keys Array of keys to retrieve.
@param bool $with_cas If true, retrieve the CAS tokens for the keys.
@param callable $value_cb The result callback.

@return bool true on success, or false on failure.
Issues a request to memcache for multiple items the keys of which are specified in the keys array . Currently this method executes synchronously .