duomark/repdis — pull request #1 by jaynel (2014-03-04 23:42:31+00:00)
Title: Initial implementation and test of repdis_pd

The module repdis_pd starts as an implementation of redis hashes
using the process dictionary to store them. The structure is as
follows:

Redis DB Table => erlang process
Redis Key + Db_Num => { '$$REPDIS', Db_Num, Key }
An erlang Dict is stored at this Key
hget(Table, Db_Num, Key, Field) => dict:find(Field, Dict) from Dict = get(Key)

So a dictionary is stored in the process dictionary and the values
in the dictionary are the {Field, Value} pairs of the hget/hset.

The DB Table must be an atom, Db_Num is 0-15 by default and the
Field and Value can each be any iodata() value.

The purpose of this module is to provide a meck model to be used
in place of an actual redis socket so that a new process can be
launched and when it is no longer needed, the redis data is auto-
matically eliminated along with the process.