최근에 PHP 응용 프로그램에서 getDelayed
과 getMulti
을 사용하는 방법에 대해 조금 생각했습니다. getDelayed에 대한 설명서를 읽기에서PHP memcached : getDelayed & getMulti - 사용 방법은 무엇입니까?
:
"방법은 응답 기다린 당신도 Memcached가가 가져 오거나 :: 전화, 항목을 수집 할 준비가되면 바로 반환하지 않습니다. Memcached :: fetchAll. "
getMulti
과는 달리 키를 사용하려면 먼저 fetchAll을 호출해야합니다. 그러나 실제 memcached 콜은 언제 완료됩니까? fetchAll
또는 getDelayed
을 실행할 때?
$this->memcached->set('int', 99);
$this->memcached->set('string', 'a simple string');
$this->memcached->set('array', array(11, 12));
$this->memcached->getDelayed(array('int'));
$this->memcached->getDelayed(array('string'));
$this->memcached->getDelayed(array('array'));
print("<pre>".print_r($this->memcached->fetchAll())."</pre>"); // returns the array element only.
안녕하세요 올리, 답변 해 주셔서 감사합니다. 내 게시물을 예제로 업데이트했습니다. 분명히 getDelayed 호출은 이전의 모든 getDelayed를 겹쳐 쓰고 마지막 호출의 값만 리턴합니다. 내 첫 번째 게시물을 확인하고 내게 당신이 생각하는 것을 알려주십시오 – Industrial
그래, 내가 틀렸어. 내 대답을 업데이트 할게. – Oli
걱정할 필요는 없지만 그렇다면 getMulti와 getDelayed의 차이점은 무엇입니까? :) – Industrial