I thought a bit about how to use getDelayedboth the getMultiPHP application and their difference.
getDelayed
getMulti
From reading the documentation for getDelayed:
"The method does not wait for an answer and immediately returns. When you are ready to collect the items, call either Memcached :: fetch or Memcached :: fetchAll."
Thus, it is obvious that you need to call fetchAll before you have the keys available, unlike getMulti. But when is the actual memcached call made? At fetchAllor at startup getDelayed?
fetchAll
Updated with an example:
$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.
Memcache IO occurs either on getDelayedor fetchAll.
getDelayed : " , ".
, PHP . , , PHP , , fetchAll.
PHP , fetchAll, . , , Memcached .
: :
, getMulti, 5 .
getDelayed , , fetchAll, 3 .
. , getDelayed, memcache , , , . , PHP script , , memcache . , , fetchAll. , fetchAll, . , , .
getMulti fetchAll blocking. , . getDelayed , , , ( "" , ).
, getDelayed, : , , , , memcached (, html). , , getDelayed. , , .. , fetchAll, script. , , , .
Source: https://habr.com/ru/post/1747535/More articles:WebDav timeout - c #What is the correct and reliable way to store an XML string as a JSON property? - jsonWhere is the method call in the exe file? - c #How to use $ .get data to replace certain elements on a web page? - jqueryHow to find out if a DOM element is attached using Javascript or not? - javascriptGood Javascript template engine for working with JSON - javascriptDifferences between the transition from vb6 to vb2005, vb2008, vb2010 - vb.netHow to implement objects that are normalized in a database in an object-oriented design? - language-agnosticWrong choice in ListBox with VirtualizationMode = "Recycling" and SeclectionMode = "Extended"? - virtualizationWill a public primary key pose a potential security risk? - securityAll Articles