php - Memcached getDelayed alternative implementation -


I would like to use getDelayed on the PHP Cached Extension, but I think this is the right way To

Now you ask for some keys and then retrieve them all from fetch () and fetchAll () . But imagine a situation where I need to recover the 15 keys used in different parts of the page, which I do not already know, but I can ask different items to give the list. What I would like to do is give Memcached frequency this list (each component will give its part), then later when I need to retrieve them from frequency, but they are not all done at once: each component takes it.

Actually if I had to implement it then I was prohibited from using the only getDelayed and a bookGet ($ keys) method Implementing where you add the keys to the book (which in fact call getDelayed to handle these three issues, and redefine the matches :

  1. The key is booked and recovered -> return value;
  2. The key is booked but the rear -> Go and force to bring the booked keys and return the correct value;
  3. No Booked Key -> General Lookup.
< P> I want to know whether it is understood, you have thoughts on this subject and if anyone has already implemented it or maybe PECL Memkach already works in this way and in fact the document is correct Do not explain in a manner.

I think it is a bad idea to add it to PECL: the get () function should be received directly from the lamccay, which probably since the last acquisition Data has changed () / FetchAll () You did your functionality will easily be implemented by increasing the memory class for your specific purposes, which probably does not want to be in the rest of the world. 'Reserve' s' and 'Add some private stores went' key before retrieving the & amp; Redefine your received () method as you want (and probably call parent :: get () ), and you're good to go.

I do I think that I should get one more time () should be able to make more calls and hopefully instead of overwriting it, additional keys Have to add. (Hence a $ m-> getDelayed (array ('foo'); followed by $ m-> getDelayed (array ('bar'); In the fetchAll () of the key, not just the last time.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -