-
Notifications
You must be signed in to change notification settings - Fork 112
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
Don't clear non-SuckerPunch actors from registry #113
Don't clear non-SuckerPunch actors from registry #113
Conversation
@@ -39,7 +39,8 @@ def registered? | |||
end | |||
|
|||
def name | |||
klass.to_s.underscore.to_sym | |||
klass_name = klass.to_s.underscore | |||
"#{SuckerPunch::NAME_PREFIX}_#{klass_name}".to_sym |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right place to be doing this? Does the user need to know that SuckerPunch job names are being given a prefix in the Celluloid registry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be fine. I'd like to use SuckerPunch::Queue
as the way to get the queue, so I don't think it matters for the user to know anything about how they're registered in the Celluloid registry.
@brandonhilkert great feedback, thank you! I'll let you know when I've made the changes, should be over the next couple days. |
349dc9a
to
74a7ce6
Compare
* Currently `SuckerPunch::Railtie` clears all actors from the Celluloid actor registry during initialization. This is problematic because an application using SuckerPunch may have additional Celluloid actors. * In this commit I propose prefixing the names of SuckerPunch actors such that we can ensure the Celluloid registry is cleared only of SuckerPunch actors on application initialization, per @nullstyle's suggestion here: brandonhilkert#99 * Update `SuckerPunch::Queue#name` to add a prefix to queue names * Introduce `SuckerPunch.clear_queues` * Introduce `SuckerPunch::Queue.clear_all` * Update `SuckerPunch::Railtie` to use `SuckerPunch.clear_actors`
74a7ce6
to
7530413
Compare
@brandonhilkert this is ready for another look when you have some time. |
👍 Thanks again! Nice work! |
Don't clear non-SuckerPunch actors from registry
No problem! Thanks for the opportunity. |
SuckerPunch::Railtie
clears all actors from the Celluloidactor registry during initialization. This is problematic because an
application using SuckerPunch may have additional Celluloid actors.
actors such that we can ensure the Celluloid registry is cleared only
of SuckerPunch actors on application initialization, per @nullstyle's
suggestion here: Cannot use celluloid actor registry #99
SuckerPunch::Queue#name
to add a prefix to queue namesSuckerPunch.clear_actors
SuckerPunch::Railtie
to useSuckerPunch.clear_actors