2018年6月21日

php实现商城秒杀

摘要: 这一次总结和分享用Redis实现分布式锁来完成电商的秒杀功能。先扯点个人观点,之前我看了一篇博文说博客园的文章大部分都是分享代码,博文里强调说分享思路比分享代码更重要(貌似大概是这个意思,若有误请谅解),但我觉得,分享思路固然重要,但有了思路,却没有实现的代码,那会让人觉得很浮夸的,在工作中的程序猿 阅读全文

posted @ 2018-06-21 16:58 荣耀王者 阅读(380) 评论(0) 推荐(0) 编辑

一致性hash (PHP)

摘要: target, ... } * @comment 位置对应节点,用于lookup中根据位置确定要访问的节点 */ private $_positionToTarget = array(); /** * Internal map of targets to lists of positions that target is hashed to. ... 阅读全文

posted @ 2018-06-21 14:44 荣耀王者 阅读(117) 评论(0) 推荐(0) 编辑

一致性哈希(PHP核心技术与最佳实践)

摘要: serverList[$hash])) { $this->serverList[$hash] = $server; } $this->isSorted = false; return true; } /** * 移除服务器 * @param string $server ... 阅读全文

posted @ 2018-06-21 12:07 荣耀王者 阅读(182) 评论(0) 推荐(0) 编辑

导航