a lock server
hi guys, what i want:
two new commands that manage membase key-value values (using a new memcached function)
at server side:
=================
1)LOCK key value <timeout>
find 'key'
if not found{
create key with value
if can´t create key{
return ERROR
}
set key as founded
}
if founded {
return current key value
}
return ERROR
=================
2)UNLOCK key value
find 'key'
if timedout{
delete
return ERROR
}
if not found {
return ERROR
}
if value = sent value{
delete key
return sent value
}
return current key value
=================
at client side:
string memcache_lock(string key,string value,integer/float timeout);
if lock ok will return value, if not will return another value (key value or error)
string memcache_unlock(string key, string value);
if unlock ok will return value, if not will return another value (key value or error)
=================
that´s all
with this 'I' can make a lock system =] without ddlockd or another very complex lock server, i don´t nned another client library just memcached
i´m using PIC18f4550 to make a memcache protocol, i´m implementing lock at PIC code, but it´s very big and consuming a lot of ROM/RAM/CPU/network, could we implement it at server side?
thanks