gregoriusxu / booksleeve

Automatically exported from code.google.com/p/booksleeve
Other
0 stars 0 forks source link

Variadic L/RPUSH (AddFirst/AddLast) #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try and use LPUSH or RPUSH (aka AddFirst or AddLast) with a string[] or 
byte[][]

What is the expected output? What do you see instead?
Expect to be able to add many items to a list in one call, instead there is no 
method available.

What version of the product are you using? On what operating system?
1.1.0.1, Windows 7 64bit

Please provide any additional information below.
I can see support available for some other Redis 2.4 variadic commands such as 
SADD and SREM but not LPUSH / RPUSH.

Original issue reported on code.google.com by jame...@gmail.com on 12 Dec 2011 at 7:52

GoogleCodeExporter commented 8 years ago
Yes, these should be added (with it doing an automatic fallback mechanism for < 
2.4)

Original comment by marc.gravell on 12 Dec 2011 at 8:38

GoogleCodeExporter commented 8 years ago
I was wondering if this was resolved and if that fix went out with the latest? 
I have been using booksleeve for a few weeks, and I have been unable get 
AddFirst to work. Nor have I been able to get the List.set with an index.

Any updates?

Original comment by scott.cl...@wbdevops.com on 25 Sep 2013 at 7:22

GoogleCodeExporter commented 8 years ago
I'm not aware of there being a problem here. I will investigate.

Original comment by marcgrav...@forestviewschool.org.uk on 25 Sep 2013 at 7:38

GoogleCodeExporter commented 8 years ago
The following test works fine. Can you supply a failing test?

            using (var conn = Config.GetUnsecuredConnection())
            {
                const int DB = 5;
                const string Key = "issue-10-list";
                conn.Keys.Remove(DB, Key); // contents: nil
                conn.Lists.AddFirst(DB, Key, "abc"); // "abc"
                conn.Lists.AddFirst(DB, Key, "def"); // "def", "abc"
                conn.Lists.AddFirst(DB, Key, "ghi"); // "ghi", "def", "abc",
                conn.Lists.Set(DB, Key, 1, "jkl"); // "ghi", "jkl", "abc"

                var contents = conn.Wait(conn.Lists.RangeString(DB, Key, 0, -1));
                Assert.AreEqual(3, contents.Length);
                Assert.AreEqual("ghi", contents[0]);
                Assert.AreEqual("jkl", contents[1]);
                Assert.AreEqual("abc", contents[2]);
            }

Original comment by marc.gravell on 26 Sep 2013 at 11:23

GoogleCodeExporter commented 8 years ago

Original comment by marc.gravell on 26 Sep 2013 at 11:23