small medium large xlarge

Generic-user-small
01 Aug 2012, 18:04
Felix Gessert (1 post)

Hi,

cool book. Stumbled upon a mistake in the Redis Chapter:

redis.multi do
   site = redis.rpop('eric:wishlist')
   redis.lpush('eric:visited', site)
end

won’t work. Since operations in a multi block are queued/batched, redis.rpop will only return a Future, which can’t be pushed into a list. Thus, both operations can’t be combined in single Redis transaction without RPOPLPUSH.

Write “Seven More Databases in Seven Weeks”, soon ;-) Bye, Felix

Avatar_pragsmall
02 Aug 2012, 03:31
Jim R. Wilson (85 posts)

Hi Felix,

Good point! We’ll make it more clear that our code example would fail for the reason you specified. Thanks,

– Jim R. Wilson

You must be logged in to comment