-
Notifications
You must be signed in to change notification settings - Fork 6
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
Adapters #13
base: master
Are you sure you want to change the base?
Conversation
@bleonard, one issue that I am already bumping against is that the ::Sidekiq.redis is actually a method that expects a block: I can get around it by passing a proc to ResqueBus.redis:
and then doing something like this in the Resque Adapter:
A bit awkward so I am wondering if you have other ideas. Perhaps refactoring application.rb somehow? |
hmm, we'd have to do blocks as you mention for everyone that uses |
The ConnectionPool#with has a block syntax:
The readme for connection_pool offers a transition Wrapper class but it is slow performance. I am not sure that is desirable unless you know those methods in application.rb are called only at startup. |
I can take a stab at converting it to blocks if you like. |
I am already working on it though I might need help with some specs at some point. |
word. thanks. |
Another thing I discovered while testing out the Sidekiq adapter is that the ResqueBus::Subscriber was not picking up the SidekiqWorker inclusion from ResqueBus::Adapters::Sidekiq#enabled! because it doesn't inherit from ResqueBus::Worker. One way around this is to make ResqueBus::Subscriber into a class that inherits from ResqueBus::Worker and then have subscriber application classes inherit from that class rather than include as they currently do:
Otherwise to keep the old include DSL and be backwards compatible I can also create an adapter method that can be optionally overridden:
Do you have a preference or another idea? |
Also you mentioned the idea of renaming this BackgroundBus and creating ResqueBus and SidekiqBus gems. I am wondering if and how you want to set that up. This may help deal with a few remaining aspects of the code like rake tasks, specs and gem dependencies but we could probably get around those as well. |
So first, it looks like I missed a Assuming we keep it as-is, we need to add that instance method like in def perform(*args)
# instance method level support for sidekiq
self.class.perform(*args)
end You can just add that which would allow Sidekiq to work as expected I'll think about the way to do that better. Maybe the |
yes, i liked the three gem idea for a few reasons
For now, maybe we should have two spec folders (you can clone and rename There's some interesting issues about us migrating to the new code that I need to think through. For example, the new thing in Redis will broabbly be Let's get it working in this project and I'll make new repos and stuff for everything. maybe a new "organization" to hold all three (and possibly more later). |
@bleonard: I just want to make sure you saw this pull request #14. I am not trying to put pressure; I am sure you are quite busy and have already dedicated so much effort to this project. I still need to add specs for Sidekiq integration. Just let me know where you think this is headed when you get a chance. |
Switch to block syntax for ResqueBus.redis Include Sidekiq::Worker for Subscribers Add rake tasks for Sidekiq Add information on adapters in README.md
ok, just merged your stuff into this branch. it looks good! |
Following from Issue #10