Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing services w/ middleware #312

Open
markalanevans opened this issue Apr 7, 2015 · 0 comments
Open

Sharing services w/ middleware #312

markalanevans opened this issue Apr 7, 2015 · 0 comments

Comments

@markalanevans
Copy link

Goliath + RackAttack + Redis

I'd like to be able to pass the redis connection i create in the config dir to the rack middleware i created:

config['redis'] = EM::Synchrony::ConnectionPool.new size: 2 do
  Redis.new(:host => redis_host, :port => redis_port, :password => redis_password)
end

And use redis the same redis connection for my middleware.

Rack::Attack.cache.store = Rack::Attack::StoreProxy::RedisStoreProxy.new(redis)

Problem being that in middleware redis is not defined.

How might i share this connection?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant