Persist: a simple persisting table for Torch (uses Redis as a data store).
Lua
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
init.lua
persist-scm-0.rockspec
test-clear.lua
test-restore.lua
test-save.lua

README.md

PERSIST

A persisting table for Lua.

Built using Redis, it's a simple abstraction that allows one to write/read from a table that persists over sessions (the key/vals are persisted in Redis).

-- load lib:
p = require('persist')()

-- write a few things to it:
p.test = 'something'
p.test2 = {
    some = 'table',
    nested = {is=1}
}

Shut down, start again:

-- load lib:
p = require('persist')()

-- still there?
print(p.test)
print(p.test2)

The following options can be passed:

p = require('persist')({
   url = 'localhost',
   port = 6379,
   verbose = false, -- this is not only used on startup
   namespace = 'th',  -- this is the namespace in Redis
   clear = false, -- clear all the data
})