<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Lua on haifeiWu</title><link>https://haifeiWu.github.io/tags/lua/</link><description>Recent content in Lua on haifeiWu</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>whfstudio@163.com (haifeiWu)</managingEditor><webMaster>whfstudio@163.com (haifeiWu)</webMaster><copyright>© 2016～2026 haifeiWu</copyright><lastBuildDate>Tue, 12 Nov 2019 10:57:02 +0800</lastBuildDate><atom:link href="https://haifeiWu.github.io/tags/lua/index.xml" rel="self" type="application/rss+xml"/><item><title>实时数据并发写入 Redis 优化</title><link>https://haifeiWu.github.io/posts/shishishujubingfaxieru-redis-youhua/</link><pubDate>Tue, 12 Nov 2019 10:57:02 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shishishujubingfaxieru-redis-youhua/</guid><description>当前架构的逻辑是将并发请求数据写入队列中，然后起一个单独的异步线程对数据进行串行处理。这种方式的好处就是不用考虑并发的问题，当然其弊端也是显而易见的~ 根据当前业务的数据更新在秒级，key 的碰撞率较低的情况。笔者打算采用使用 CAS 乐观锁方案：使用 Lua 脚本实现 Red…</description></item><item><title>Redis 与 Lua 使用中的小问题</title><link>https://haifeiWu.github.io/posts/redis-yu-lua-shiyongzhongdexiaowenti/</link><pubDate>Fri, 08 Nov 2019 13:35:42 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/redis-yu-lua-shiyongzhongdexiaowenti/</guid><description>通过上面的脚本可以看到，当 Redis 返回的结果为 (nil) 时候，其真实的数据类型为 boolean，因此我们直接判断 nil 是有问题的。Redis to Lua conversion table. Lua to Redis conversion table. Lua…</description></item></channel></rss>