Closed karloscodes closed 10 years ago
Autooad path is like this instead of above!
config.autoload_paths << File.expand_path(File.join(ENGINE_RAILS_ROOT, 'app', 'workers', 'my_engine'))
To use a namespaced worker in the DSL, you'll want to replace, for example, AWorker
with MyEngine__AWorker
. There's more information about this in #13.
This wasn't previously mentioned in the README, but I've added it. Let me know if that doesn't fix this for you. Thanks!
I’m using 0.1.8 and it is not working I’m getting uninitialized constant MyEngine__AWorker (NameError)
Should I need to grab github version or am I missing something?
I wonder if autoload path on the engine declaration should be changed by requires…
Does the worker have any arguments passed to it in the DSL block? If it doesn't, be sure to add parentheses after it (as described here).
If that isn't the issue, you may be correct that autoloading isn't sufficient, and that explicit requires are necessary. If you could let me know whether requiring the workers before defining the superworker fixes this, that'd be great, as it might make sense to add support for autoloading into Sidekiq Superworker.
Doing manual requires solved the problem, so the issue was autoloading,
Thanks!
De: Tom Benner [mailto:notifications@github.com] Enviado el: Sunday, June 22, 2014 2:26 PM Para: socialpandas/sidekiq-superworker CC: Carlos Castellanos Asunto: Re: [sidekiq-superworker] Superworker namespace issues (#23)
Does the worker have any arguments passed to it in the DSL block? If it doesn't, be sure to add parentheses after it (as described here https://github.com/socialpandas/sidekiq-superworker#arguments ).
If that isn't the issue, you may be correct that autoloading isn't sufficient, and that explicit requires are necessary. If you could let me know whether requiring the workers before defining the superworker fixes this, that'd be great, as it might make sense to add support for autoloading into Sidekiq Superworker.
— Reply to this email directly or view it on GitHub https://github.com/socialpandas/sidekiq-superworker/issues/23#issuecomment-46788596 . https://github.com/notifications/beacon/1001834__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxOTA4MDc1OSwiZGF0YSI6eyJpZCI6MzUyMzA5ODB9fQ==--08f12b06ec3d71933b388c15fc29ce48d30e72ad.gif
I have this code inside a rails engine:
The problem I'm facing is that the workers are under the engine namespace and Superworker does not understand MyEngine::AWorker notation, how can this be solved? Workers path was added to the autoload path using:
What might be the problem?