One currently missing feature is the ability to pipeline message to Redis. This means sending multiple messages and start reading the replies after all messages have been sent. This reduces round trips and thus seriously improves performance. It is related to Redis transactions. I think we should support these. I’m wondering about the syntax though. One option could be
?- redis_multi(Server,
[ cmd1 -> result1,
cmd2 -> result2,
cmd3
]).
In theory would could overload this on redis/2 to create a pipeline by default and a transaction if multi
and exec
are used.
One issue is the Command -> Result
. I kind of like the syntax, but it is not ISO compliant, which would ask for (Command -> Result)
, making it less attractive. Alternatively we could use
Result = Command
Which would be fully ISO compliant. On the other hand, the library uses threads, strings, dicts a bit of C code and quite a few non-ISO predicates, so portability is far away anyway.
What to do?