client libraries synched in git

This commit is contained in:
antirez
2009-05-26 18:10:50 +02:00
parent e083d75262
commit d7fc9edb18
18 changed files with 533 additions and 454 deletions

View File

@ -1,9 +1,16 @@
+ finish command implementations
= finish unit tests
Only a few left, to test the SORT command's edge cases (e.g. BY pattern)
+ determine if we should not use bool return values and instead throw redis_error. (latter).
+ maybe more fine-grained exceptions (not just redis_error but operation_not_permitted_error, etc.)
- benchmarking
command handlers:
- support DEL as vararg
- support MLLEN and MSCARD
unit tests:
- sort with limit
- sort lexicographically
- sort with pattern and weights
extras:
- benchmarking "test" app
- consistent hashing?
- make all string literals constants so they can be easily changed (minor)
maybe/someday:
- make all string literals constants so they can be easily changed
- add conveniences that store a std::set in its entirety (same for std::list, std::vector)

View File

@ -663,16 +663,24 @@ namespace redis
const client::string_type & by_pattern,
client::int_type limit_start,
client::int_type limit_end,
const client::string_type & get_pattern,
const client::string_vector & get_patterns,
client::sort_order order,
bool lexicographically)
{
send_(makecmd("SORT") << key
<< " BY " << by_pattern
<< " LIMIT " << limit_start << ' ' << limit_end
<< " GET " << get_pattern
<< (order == sort_order_ascending ? " ASC" : " DESC")
<< (lexicographically ? " ALPHA" : ""));
makecmd m("SORT");
m << key
<< " BY " << by_pattern
<< " LIMIT " << limit_start << ' ' << limit_end;
client::string_vector::const_iterator it = get_patterns.begin();
for ( ; it != get_patterns.end(); ++it)
m << " GET " << *it;
m << (order == sort_order_ascending ? " ASC" : " DESC")
<< (lexicographically ? " ALPHA" : "");
send_(m);
return recv_multi_bulk_reply_(out);
}
@ -681,7 +689,7 @@ namespace redis
{
send_(makecmd("SAVE", true));
recv_ok_reply_();
e.g. }
}
void client::bgsave()
{

View File

@ -421,7 +421,7 @@ namespace redis
const string_type & by_pattern,
int_type limit_start,
int_type limit_end,
const string_type & get_pattern,
const string_vector & get_patterns,
sort_order order = sort_order_ascending,
bool lexicographically = false);