libredis-Redis PHP扩展


项目地址:libredis on github



$libredis = Libredis();
$connection = $libredis->get_connection("");
//set a key
$batch = $libredis->create_batch();
$batch->set('hello', 'world');
//now fetch the key
$batch = $libredis->create_batch();
while($batch->next_reply($reply_type, $reply_value, $reply_length)) {
      echo $reply_value, PHP_EOL;

实例二:(multiple server模式)

$libredis = Libredis();
$connection1 = $libredis->get_connection("");
$connection2 = $libredis->get_connection("");
$batch1 = $libredis->create_batch();
$batch1->set('hello', 'world'); //add a 'set' command to batch1
$batch2 = $libredis->create_batch();
$batch2->set('hello2', 'world2');
$executor = $libredis->create_executor();
$executor->add($connection1, $batch1); //associate connection1 with batch1
$executor->add($connection2, $batch2); //associate connection2 with batch2
//execute all batches against their corresponding connections in parallel, with a
//500 ms timeout on the whole operation.



分类 Redis · tag , ,

  1. PHP官方还没有redis的扩展么?感觉这个语法写的与PHP别的扩展习性差距比较大啊

  2. Pingback:

  3. Pingback: sears auto engine oil change coupon 2012

  4. Pingback: read more

  5. Pingback: Furnace & AC Combos

  6. Pingback: ver peliculas gratis online

  7. Pingback: Hope Reichert

  8. Pingback: carpet cleaning denver

  9. Pingback: cheap wall mounts

  10. Pingback: Baby Swing reviews

  11. Pingback: cosmetic dentistry

  12. Pingback: visit

  13. Pingback: website

  14. Pingback: tatuaggi

  15. Pingback: Pure Credit Loans

  16. Pingback:

  17. Pingback: retoucheren

  18. Pingback: gmail iniciar sesion

  19. Pingback: bad credit loans

  20. Pingback: Click here

  21. Pingback: here

  22. Pingback: stardoll cheats for clothes

  23. Pingback: buy phen375

  24. Pingback: maillot de foot pas cher

  25. Pingback: louis vuitton shop online