Closed trungpham closed 9 years ago
Are you requiring sucker_punch in startup? Rails?
On Monday, February 16, 2015, Trung Pham notifications@github.com wrote:
https://github.com/brandonhilkert/sucker_punch/blob/master/lib/sucker_punch/railtie.rb#L8 SuckerPunch is blindly clearing out the actor registry.
— Reply to this email directly or view it on GitHub https://github.com/brandonhilkert/sucker_punch/issues/99.
_Build a Ruby Gem is available! http://brandonhilkert.com/books/build-a-ruby-gem/?utm_source=gmail-sig&utm_medium=email&utm_campaign=gmail_
Gemfile
Happy to try and help more if you can post code you're using.
:+1:
This makes registering actors in config/initializers
a bit of a pain because the to_prepare
block that clears the registry will run after the initializer files.
You have to wrap your actor initialization in a Railtie (or add it to your after_initialize
config) like so:
class FriendbotRailtie < ::Rails::Railtie
config.to_prepare do
Friendbot.supervise_as :friendbot
end
end
It seems like a better solution would be to prefix all the suckerpunch actor names such that you only clear the suckerpunch owned actors. Would you be open to a PR that does this?
Sure!
On Tuesday, April 7, 2015, Scott Fleckenstein notifications@github.com wrote:
It seems like a better solution would be to prefix all the suckerpunch actor names such that you only clear the suckerpunch owned actors. Would you be open to a PR that does this?
— Reply to this email directly or view it on GitHub https://github.com/brandonhilkert/sucker_punch/issues/99#issuecomment-90749535 .
_Build a Ruby Gem is available! http://brandonhilkert.com/books/build-a-ruby-gem/?utm_source=gmail-sig&utm_medium=email&utm_campaign=gmail_
https://github.com/brandonhilkert/sucker_punch/blob/master/lib/sucker_punch/railtie.rb#L8 SuckerPunch is blindly clearing out the actor registry.