Can't distribute all reads in a job, or any file
justincarrao opened this issue · comments
Justin commented
Distribute all reads in a job with:
distribute_reads
def perform
# ...
end
end
This leads to the following error:
LocalJumpError: no block given (yield) from my_gem_path/distribute_reads/global_methods.rb:11:in `distribute_reads'
Andrew Kane commented
Hey @justincarrao, make sure:
- You're on the latest version
- You do this in an ActiveJob (not just any file)
Justin commented
@ankane Understood, thank you. I'm going to close this for now then.
Are there any plans going forward to add this functionality to any file?
For example, if some model is backed by a huge table and we want that specific model to always read from a replica, this would be a really nice feature.
I'd be happy to collaborate or put some time into this myself as well
Keerthi Nallani commented
@ankane it's been awhile this feature was requested. Wanna check the status of this feature.