diff --git a/doc/BrpoplpushCommand.html b/doc/BrpoplpushCommand.html new file mode 100644 index 000000000..ba45eab00 --- /dev/null +++ b/doc/BrpoplpushCommand.html @@ -0,0 +1,39 @@ + + + +
+ + + +Blocking version of the RPOPLPUSH command. Atomically removes and returnsthe last element (tail) of the source list at srckey, and as a side effect pushes the returned element in the head of the list at dstkey.+If the source list is empty, the client blocks until another client pushes against the source list. Of course in such a case the push operation against the destination list will be performed after the command unblocks detecting a push against the source list.
Returns the bit value at offset in the string value stored at key.+When offset is beyond the string length, the string is assumed to be a contiguous space with 0 bits. When key does not exist it is assumed to be an empty string, so offset is always out of range and the value is also assumed to be a contiguous space with 0 bits.
Retrieve the values associated to the specified fields.+
If some of the specified fields do not exist, nil values are returned.Non existing keys are considered like empty hashes.+
+WATCH foo +old_value = HGET foo field +MULTI +HSET foo field new_value +EXEC +
+WATCH foo +score = ZSCORE foo bar +IF score != NIL + MULTI + ZADD foo 1 bar + EXEC +ENDIF ++
+$ (echo -en "PING\r\nPING\r\nPING\r\n"; sleep 1) | nc localhost 6379 ++PONG ++PONG ++PONG ++This time we are not paying the cost of RTT for every call, but just one time for the three commands.
+require 'rubygems' +require 'redis' + +def bench(descr) + start = Time.now + yield + puts "#{descr} #{Time.now-start} seconds" +end + +def without_pipelining + r = Redis.new + 10000.times { + r.ping + } +end + +def with_pipelining + r = Redis.new + r.pipelined { + 10000.times { + r.ping + } + } +end + +bench("without pipelining") { + without_pipelining +} +bench("with pipelining") { + with_pipelining +} ++Running the above simple script will provide this figures in my Mac OS X system, running over the loopback interface, where pipelining will provide the smallest improvement as the RTT is already pretty low: +
+without pipelining 1.185238 seconds +with pipelining 0.250783 seconds ++As you can see using pipelining we improved the transfer by a factor of five. +
+$ git clone git://github.com/antirez/redis.git +Initialized empty Git repository in /tmp/redis/.git/ +... ++Then you can list all the branches matching 2.1-alpha with: +
+cd redis +$ git tag | grep 2.2-alpha +2.2-alpha0 +2.2-alpha1 +2.2-alpha2 ++At this point you can just use git checkout tagname, substituting tagname with 2.2-alphaX where X is the greater progressive number you see in the listing.
Sets or clears the bit at offset in the string value stored at key.+The bit is either set or cleared depending on value, which can be either 0 or 1. When key does not exist, a new string value is created. The string is grown to make sure it can hold a bit at offset. The offset argument is required to be greater than or equal to 0, and is limited to 232-1 (which limits bitmaps to 512MB). +When the string at key is grown, added bits are set to 0.
Overwrites part of a string at key starting at the specified offset,for all the length of value.If the offset is over the old length of the string, the string is paddedwith zero bytes until needed. Non existing keys are considered likealready containing an empty string.+
+redis> set foo "Hello World" +OK +redis> setrange foo 6 "Redis" +(integer) 11 +redis> get foo +"Hello Redis" +Example of the zero padding behavior.
+redis> del foo +(integer) 1 +redis> setrange foo 10 bar +(integer) 13 +redis> get foo +"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00bar" +Note that the maximum offset that you can set is 536870911 as Redis Strings are limited to 512 megabytes. You can still create longer arrays of values using multiple keys.
Returns the length of the string stored at the specified key.+