Sha256: b3894411e369b4ff83a602979290730a2d6a7e46d6bd4564f9b8d7afc8c8f6eb

Contents?: true

Size: 443 Bytes

Versions: 103

Compression:

Stored size: 443 Bytes

Contents

require 'rubygems'
require 'redis'

r = Redis.new

r.del 'logs'

puts

p "pushing log messages into a LIST"
r.rpush 'logs', 'some log message'
r.rpush 'logs', 'another log message'
r.rpush 'logs', 'yet another log message'
r.rpush 'logs', 'also another log message'

puts
p 'contents of logs LIST'

p r.lrange('logs', 0, -1)

puts
p 'Trim logs LIST to last 2 elements(easy circular buffer)'

r.ltrim('logs', -2, -1)

p r.lrange('logs', 0, -1)

Version data entries

103 entries across 101 versions & 16 rubygems

Version Path
finsync_redis-3.3.5 examples/list.rb
redis-4.0.3 examples/list.rb
redis-4.1.0.beta1 examples/list.rb
redis-4.0.2 examples/list.rb
redis-3.3.5 examples/list.rb
redis-4.0.1 examples/list.rb
redis-4.0.0 examples/list.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/list.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/list.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/list.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/redis-3.3.3/examples/list.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/redis-3.3.3/examples/list.rb
redis-3.3.3 examples/list.rb
abaci-0.3.0 vendor/bundle/gems/redis-2.2.2/examples/list.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.1/examples/list.rb
abaci-0.3.0 vendor/bundle/gems/redis-3.3.2/examples/list.rb
redis-4.0.0.rc1 examples/list.rb
redis-3.3.2 examples/list.rb
redis-3.3.1 examples/list.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/redis-3.3.0/examples/list.rb