Skip to content

Initial implementation and test of repdis_pd #1

Merged
merged 1 commit into from Mar 4, 2014
Commits on Mar 4, 2014
  1. @jaynel

    Initial implementation and test of repdis_pd

    jaynel committed Mar 4, 2014
    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(Field) => dict:find(Field, Dict) from 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.
Something went wrong with that request. Please try again.