1

I've been using Booksleeve as my redis driver in C# and have been quite happy with it - but I have come across the need to do some work with sorted sets. It appears that these only have minimal support within Booksleeve - there are no implementations of commands like ZUNIONSTORE or ZINTERSTORE, for example.

I have found scobrown's fork of Booksleeve on Github which claims to have implemented these operations, but I've been using the "official" package from NuGet and I'm unsure about switching to another fork instead.

Has anyone had experience with using this fork? Is it stable, and reliable enough for production code?

Otherwise, has anyone come up with any other work-arounds for needing to do things like intersections or unions on sorted sets? I've been doing something like the following:

var set = await conn.SortedSets.Range(db, firstSet, 0, -1);
set = set.Intersect(await conn.SortedSets.Range(db, secondSet, 0, -1));
set = set.Intersect(await conn.SortedSets.Range(db, thirdSet, 0, -1));

which has the obvious disadvantage of needing to retrieve the full contents of the sets one at a time, and perform the intersection using .NET's IEnumerable<>.Intersect() instead of doing it within redis. Is there a better way?

rejj
  • 1,216
  • 7
  • 13
  • Did you consider ServiceStack instead? I don't do C# at the moment so I can't speak from personal experience but from what I heard I get the impression ServiceStack development is more active. – Mahn Oct 08 '12 at 02:30
  • I had a brief look at ServiceStack, but picked Booksleeve originally because I liked the multiplex style implementation it offers. I may have to switch if it becomes impossible to do the sorts of operations I need, however – rejj Oct 08 '12 at 02:34

1 Answers1

1

I have merged in johanalkemad's branch which includes SortedSets.UnionAndStore and SortedSets.IntersectAndStore. Build 1.1.0.9 has been pushed to NuGet.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900