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

Load multiple workers #245

Closed
rubemz opened this issue Sep 7, 2016 · 6 comments
Closed

Load multiple workers #245

rubemz opened this issue Sep 7, 2016 · 6 comments

Comments

@rubemz
Copy link
Contributor

rubemz commented Sep 7, 2016

How can I load multiple works using shoryuken?

The shoryuken -r option seems to be designed to load just one worker.

Thanks

@rubemz
Copy link
Contributor Author

rubemz commented Sep 8, 2016

nm, misread the docs. closing

@rubemz rubemz closed this as completed Sep 8, 2016
@greggilbert
Copy link

@rubemz What was your solution to this?

@rubemz
Copy link
Contributor Author

rubemz commented Jan 4, 2017

@geekguy the -r option should be working now, per #248

@greggilbert
Copy link

@rubemz Ah, the issue was that I was running 2.0.11 locally rather than 2.1.x. Thanks.

For anyone else who isn't good at reading like me, -r DIR will work; e.g. bundle exec shoryuken -r ./lib/workers/ -C ./config/shoryuken.yml

@phstc
Copy link
Collaborator

phstc commented Jan 4, 2017

@greggilbert 🍻

Another option, I usually use is to -r workers.rb and in this file I require the workers I need.

@greggilbert
Copy link

@phstc Yeah, I wired up something wonky like that at first:

require 'pathname'
this_file_path = Pathname.new(__FILE__)
this_dirname = this_file_path.dirname
Dir.glob("#{this_dirname}/*.rb").each do |file|
  next if file == $0
  require_relative Pathname.new(file).basename
end

but being able to add the whole folder on its own is nice too.

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

No branches or pull requests

3 participants