首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > PHP > 一致的哈希PHP库

一致的哈希PHP库

  • 资源大小:8.41 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: php flexihash consistenthashing

资 源 简 介

Flexihash NOTE: [Flexihash has moved to GitHub](http://github.com/pda/flexihash) Flexihash is a small PHP library which implements consistent hashing, which is most useful in distributed caching. It requires PHP5 and uses SimpleTest for unit testing. Usage Example ``` addTargets(array("cache-1", "cache-2", "cache-3")); // simple lookup $hash->lookup("object-a"); // "cache-1" $hash->lookup("object-b"); // "cache-2" // add and remove $hash ->addTarget("cache-4") ->removeTarget("cache-1"); // lookup with next-best fallback (for redundant writes) $hash->lookupList("object", 2); // ["cache-2", "cache-4"] // remove cache-2, expect object to hash to cache-4 $hash->removeTarget
VIP VIP
0.181571s