Project

jedis_rb

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Ruby gem which wraps the Jedis Redis Java client, for use with JRuby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
>= 0
 Project Readme

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.