[asterisk-dev] [Code Review] memcached utilities for asterisk dialplans

Brad Latus reviewboard at asterisk.org
Wed Apr 13 22:41:33 CDT 2011



> On 2011-03-29 14:05:22, Brad Latus wrote:
> > I would follow oej's view, it should be more like the DB functions since they do the same.
> > Also throughout the code your not following some of the CODING-GUIDELINES.txt
> > Main thing I noticed was that you declare variables all around the code, all variables must be declared at top of scope. 
> > You also have no message/default if people happen to specify an invalid or wrong hash function (at my quick look)
> 
> drivefast wrote:
>     (sorry for the late response.)
>     
>     i tried to keep close to the way memcached defines the operations, rather than focusing on providing similarity with the DB functions. and to be honest, i'm no big fan of asterisk's "writing" functions, they look to me like functions called for their side effect. i am however open to suggestions, and if you can be more specific on how would you see those functions, i would be happy to provide additional calling conventions, or replace the existing ones.

I would probably do the following:
Function of MCD()
MCD(<key>,[,<timeout>,<option>])

Applications would go away, so no mcdadd/mcdget/mcdset..
The 'option' flag would be for 'appending' or 'deleting' a value, or simply a blank value would delete the key.

Basically all commands would be Set(MCD(key)=val) or Set(val=${MCD(key)}) etc

Let me know what you think.

I had some of my own code (which isn't very good i was bored and attempted to make a module) under asterisk/team/snuffy/func_memcached

I probably tried to 'over engineer' it allowing different memcache servers / duplicating memcache keys to multiple servers etc..


- Brad


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1139/#review3263
-----------------------------------------------------------


On 2011-03-15 11:56:21, drivefast wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1139/
> -----------------------------------------------------------
> 
> (Updated 2011-03-15 11:56:21)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> memcached utilities for asterisk dialplans
> 
> 
> Diffs
> -----
> 
>   /trunk/build_tools/menuselect-deps.in 310878 
>   /trunk/configs/memcached.conf.sample PRE-CREATION 
>   /trunk/configure.ac 310878 
>   /trunk/makeopts.in 310878 
>   /trunk/res/res_memcached.c PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/1139/diff
> 
> 
> Testing
> -------
> 
> dialplan that touches all the functions and apps
> 
> 
> Thanks,
> 
> drivefast
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110414/8a2b138c/attachment.htm>


More information about the asterisk-dev mailing list