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

Distribute updates to multiple Redis instances #241

Open
damnitjim opened this issue Nov 2, 2019 · 0 comments
Open

Distribute updates to multiple Redis instances #241

damnitjim opened this issue Nov 2, 2019 · 0 comments

Comments

@damnitjim
Copy link

damnitjim commented Nov 2, 2019

I have use case where I'm trying to create a new model instance for an array of Redis hosts. I currently have this executing in a Sidekiq job, which relies on threads. I'm getting varying results of writes to each host. For example, I'll process 100 jobs and each host will not have the same number of updates. Is there any way to accomplish this with Ohm?

hosts = ['192.168.1.1', '192.168.1.2', '192.168.1.3','192.168.1.4']

hosts.each do |host|
  Event.redis = Redic.new("redis://#{host}:6379")
  Event.create :name => "Ohm Worldwide Conference 2031"
end
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