Skip to content

Persist: a simple persisting table for Torch (uses Redis as a data store).

Notifications You must be signed in to change notification settings

clementfarabet/persist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
})

About

Persist: a simple persisting table for Torch (uses Redis as a data store).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages