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

Don't clear non-SuckerPunch actors from registry #113

Merged

Conversation

malandrina
Copy link
Contributor

  • 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: Cannot use celluloid actor registry #99
  • Update SuckerPunch::Queue#name to add a prefix to queue names
  • Introduce SuckerPunch.clear_actors
  • Update SuckerPunch::Railtie to use SuckerPunch.clear_actors

@@ -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
Copy link
Contributor Author

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?

Copy link
Owner

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.

@malandrina
Copy link
Contributor Author

@brandonhilkert great feedback, thank you! I'll let you know when I've made the changes, should be over the next couple days.

* 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`
@malandrina malandrina force-pushed the lw-clear-actor-registry branch from 74a7ce6 to 7530413 Compare May 12, 2015 01:43
@malandrina
Copy link
Contributor Author

@brandonhilkert this is ready for another look when you have some time.

@brandonhilkert
Copy link
Owner

👍 Thanks again! Nice work!

brandonhilkert added a commit that referenced this pull request May 12, 2015
Don't clear non-SuckerPunch actors from registry
@brandonhilkert brandonhilkert merged commit d0fc347 into brandonhilkert:master May 12, 2015
@malandrina
Copy link
Contributor Author

No problem! Thanks for the opportunity.

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

Successfully merging this pull request may close these issues.

2 participants