1659092839
Redis Store provides a full set of stores (Cache, I18n, Session, HTTP Cache) for modern Ruby frameworks like: Ruby on Rails, Sinatra, Rack, Rack::Cache and I18n. It supports object marshalling, timeouts, single or multiple nodes, and namespaces.
Please check the README file of each gem for usage and installation guidelines.
MacOS X users should use Homebrew to install Redis:
brew install redis
Download and install Redis from the download page and follow the instructions.
git clone git://github.com/redis-store/redis-store.git
cd redis-store
bundle install
bundle exec rake
If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" ruby ci/run.rb
https://github.com/redis-store/redis-store/graphs/contributors
The redis-store family of gems uses Semantic Versioning, meaning gems depending on redis-store can be reliably inclusive of any version between the current and the next major. We recommend the following dependency in your library's gemspec:
s.add_dependency 'redis-store', '>= 1.4', '< 2'
2009 - 2013 Luca Guidi - http://lucaguidi.com, released under the MIT license.
Author: redis-store
Source code: https://github.com/redis-store/redis-store
License: MIT license
1596679140
Redis offers two mechanisms for handling transactions – MULTI/EXEC based transactions and Lua scripts evaluation. Redis Lua scripting is the recommended approach and is fairly popular in usage.
Our Redis™ customers who have Lua scripts deployed often report this error – “BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE”. In this post, we will explain the Redis transactional property of scripts, what this error is about, and why we must be extra careful about it on Sentinel-managed systems that can failover.
Redis “transactions” aren’t really transactions as understood conventionally – in case of errors, there is no rollback of writes made by the script.
“Atomicity” of Redis scripts is guaranteed in the following manner:
It is highly recommended that the script complete within a time limit. Redis enforces this in a weak manner with the ‘lua-time-limit’ value. This is the maximum allowed time (in ms) that the script is allowed to run. The default value is 5 seconds. This is a really long time for CPU-bound activity (scripts have limited access and can’t run commands that access the disk).
However, the script is not killed when it executes beyond this time. Redis starts accepting client commands again, but responds to them with a BUSY error.
If you must kill the script at this point, there are two options available:
It is usually better to just wait for the script to complete its operation. The complete information on methods to kill the script execution and related behavior are available in the documentation.
#cloud #database #developer #high availability #howto #redis #scalegrid #lua-time-limit #redis diagram #redis master #redis scripts #redis sentinel #redis servers #redis transactions #sentinel-managed #server failures
1659151800
redis-sinatra
provides a Redis backed cache store for Sinatra. See the main redis-store readme for general guidelines.
# Gemfile
gem 'redis-sinatra'
require 'sinatra'
require 'redis-sinatra'
class MyApp < Sinatra::Base
register Sinatra::Cache
get '/hi' do
settings.cache.fetch('greet') { 'Hello, World!' }
end
end
Keep in mind that the above fetch will return "OK"
on success, not the return of the block.
gem install bundler
git clone git://github.com/redis-store/redis-sinatra.git
cd redis-sinatra
bundle install
bundle exec rake
If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" bundle exec rake
2009 - 2013 Luca Guidi - http://lucaguidi.com, released under the MIT license
Author: redis-store
Source code: https://github.com/redis-store/redis-sinatra
License: MIT license
1659144420
redis-i18n
provides a Redis backend for I18n. See the main redis-store readme for general guidelines.
# Gemfile
gem 'redis-i18n'
I18n.backend = I18n::Backend::Redis.new
gem install bundler
git clone git://github.com/redis-store/redis-i18n.git
cd redis-i18n
bundle install
bundle exec rake
If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" bundle exec rake
2009 - 2013 Luca Guidi - http://lucaguidi.com, released under the MIT license
Author: redis-store
Source code: https://github.com/redis-store/redis-i18
License: MIT license
1659092839
Redis Store provides a full set of stores (Cache, I18n, Session, HTTP Cache) for modern Ruby frameworks like: Ruby on Rails, Sinatra, Rack, Rack::Cache and I18n. It supports object marshalling, timeouts, single or multiple nodes, and namespaces.
Please check the README file of each gem for usage and installation guidelines.
MacOS X users should use Homebrew to install Redis:
brew install redis
Download and install Redis from the download page and follow the instructions.
git clone git://github.com/redis-store/redis-store.git
cd redis-store
bundle install
bundle exec rake
If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" ruby ci/run.rb
https://github.com/redis-store/redis-store/graphs/contributors
The redis-store family of gems uses Semantic Versioning, meaning gems depending on redis-store can be reliably inclusive of any version between the current and the next major. We recommend the following dependency in your library's gemspec:
s.add_dependency 'redis-store', '>= 1.4', '< 2'
2009 - 2013 Luca Guidi - http://lucaguidi.com, released under the MIT license.
Author: redis-store
Source code: https://github.com/redis-store/redis-store
License: MIT license
1659129660
redis-actionpack
provides a session store for ActionPack, specifically for ActionDispatch. See the main redis-store readme for general guidelines.
For guidelines on using our underlying cache store, see the main redis-store readme.
For information on how to use this library in a Rails app, see the documentation for redis-rails.
If, for some reason, you're using ActionDispatch
and not in a Rails app, read on to learn how to install/use this gem by itself!
# Gemfile
gem 'redis-actionpack'
If you are using redis-store with Rails, head on over to the redis-rails README to learn how to integrate this gem into your Rails application.
For standalone usage:
ActionController::Base.session_store = :redis_store,
servers: %w(redis://localhost:6379/0/session),
expire_after: 90.minutes,
key: '_my_application_session',
threadsafe: false,
secure: true
A brief run-down of these options...
false
if you want to disable the global mutex lock on session data. It's true
by default, meaning the mutex will be enabled.gem install bundler
git clone git://github.com/redis-store/redis-actionpack.git
cd redis-actionpack
bundle install
bundle exec rake
If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" bundle exec rake
2009 - 2013 Luca Guidi - http://lucaguidi.com, released under the MIT license
Author: redis-store
Source code: https://github.com/redis-store/redis-actionpack
License: MIT license