Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Initial implementation and test of repdis_pd #1

Merged
merged 1 commit into from Mar 4, 2014

Conversation

Projects
None yet
1 participant
Owner

jaynel commented 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(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.

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(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.

jaynel added a commit that referenced this pull request Mar 4, 2014

Merge pull request #1 from duomark/features
Initial implementation and test of repdis_pd

@jaynel jaynel merged commit 77bbf19 into master Mar 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment