Skip to content

Ruby gem which wraps the Jedis Redis Java client, for use with JRuby

License

Notifications You must be signed in to change notification settings

asmallworldsite/jedis_rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JedisRb

A JRuby wrapper around the Jedis client library for Redis. Requires JRuby.

Installation

Add this line to your application's Gemfile:

gem 'jedis_rb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jedis_rb

Usage

RedisPool = JedisRb::Pool.new
=> #<JedisRb::Pool:0x19fe4644 @pool=#<Java::RedisClientsJedis::JedisPool:0x21d8bcbe>>
RedisPool.execute(:ping)
=> "PONG"
RedisPool.execute :get, 'foo'
=> nil
RedisPool.execute :set, 'foo', 'fish'
=> "OK"
RedisPool.execute :get, 'foo'
=> "fish"
RedisPool.execute :setex, 'foo', 600, 'fish'
=> "OK"

Or reusing one connection, in a block:

RedisPool.yield_connection do |c|
  c.set ..., ...
  c.sadd ..., ...
  c.get ...
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/asmallworldsite/jedis_rb.

License

The gem is available as open source under the terms of the MIT License.

About

Ruby gem which wraps the Jedis Redis Java client, for use with JRuby

Resources

License

Stars

Watchers

Forks

Packages

No packages published