我在 Heroku 上使用 Redis To Go,我想用它来存储一些数据和 Resque 作业,就像我可以将 DelayedJobs 存储在与模型数据的其余部分相同的 Postgres 数据库中一样。
这可能吗?想简要解释一下 Resque 如何在 Redis 中存储作业?我是 Redis 的新手,虽然我在更高层次上了解它的工作原理,但我不熟悉实现细节。
最佳答案
是的,你可以。根据 Resque 文档:
Resque has a redis setter which can be given a string or a Redis object. This means if you're already using Redis in your app, Resque can re-use the existing connection.
此外,Resque.redis=
的文档声明接受命名空间,以防止与在同一实例上运行的其他应用发生冲突:
A 'hostname:port/namespace' String (to set the Redis namespace)
查看 Resque 自述文件的“配置”部分以获取更多信息:https://github.com/resque/resque/blob/master/README.markdown
关于ruby-on-rails - 您可以将 Redis 与 Resque 一起使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7069542/