Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
LeafStorm
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
41 ms
·
421.
▲
by
LeafStorm
15y ago
You could implement a forward-compatible database function table like this: local function accesscommand (t, key) local f = function (...) return redis(key, ...) end t[key] = f return key end db = setmetatable(
422.
▲
by
LeafStorm
16y ago
On second thought, doing this automatically might be a waste of time for most one-shot commands. Perhaps a separate COEVAL command would work better for this.
423.
▲
by
LeafStorm
16y ago
That could be implemented fairly easily using coroutines. Redis could start the script in a coroutine, then if it yields, return whatever values it yielded back to the user and schedule the coroutine to be finished later. When Redis has not
424.
▲
by
LeafStorm
16y ago
I am glad that Lua was chosen as the implementation language. It really is a perfect fit for the problem. "Redis will try to be smart enough to reuse an interpreter with the command defined." Caching the scripts should be fairly simple. Mai