Hi, Chickeneers--
I'm back again! Though I have never been a key member of this community, so
you are forgiven for not remembering me ;-)
Anyway, I am planning to develop a rather ambitious project using Redis,
and have been experimenting with the redis-client egg. Thanks to Carl
Douglas for developing it! But I have noticed a couple of minor problems
with the egg; one at least is surely a bug. Oh, and I am using version 0.7
of the egg with Chicken 4.7.0 & Redis 2.4.15 on Arch Linux.
Issue #1
-----------
Nil responses are not handled in some cases, e.g.:
csi> (redis-hset "goodies" "wine" "merlot")
(1)
csi> (redis-hset "goodies" "cheese" "gouda")
(1)
csi> (redis-hget "goodies" "wine")
("merlot")
csi> (redis-hget "goodies" "cheese")
("gouda")
csi> (redis-hget "goodies" "fruit") ; Querying a non-existent field
; never returns
When I do this in the command-line client (redis-cli), the response is
(nil) . At any rate, it is handled gracefully. Should be in our library,
too, I would think.
Issue #2
-----------
I don't know if this is really a bug, or just a feature I don't like, but
if a Scheme error (such as invalid input) is raised in the midst of a
transaction, the client seems to be rendered useless.
csi> (redis-multi)
("OK")
csi> (redis-sadd "abc" "def")
("QUEUED")
csi> (redis-hset "xyz" '())
Error: (string-length) bad argument type: ()
Call history:
<syntax> (redis-hset "xyz" (quote ()))
<syntax> (quote ())
<syntax> (##core#quote ())
<eval> (redis-hset "xyz" (quote ())) <--
csi> (redis-sismember "abc" "def")
("QUEUED")
csi> (redis-lpush "fubar" "baz")
("QUEUED")
csi> (redis-lpop "fubar")
("QUEUED")
In other words, any further commands simply produce the response
("QUEUED"). Now, I have found that I can write an exception handler that
calls (redis-discard), and that seems to solve the problem. But what would
make the most sense to me is to build an exception handler into the client
library that would discard the transaction and then re-raise the exception.
What says the community?
Also ... though I'm far from an expert Schemer, if Carl is not available to
work on this stuff, I will attempt to fix the egg, and if I am able to do
so, I'd be happy to contribute my fixes to the community.
--
Matt Gushee
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users