bkeepers / qu

a Ruby library for queuing and processing background jobs.
MIT License
506 stars 50 forks source link

Add deployment information to the wiki #28

Closed codesnik closed 10 years ago

codesnik commented 13 years ago

running rake task is simple for development, but what if we updated worker code and want to deploy a new one? somthing should find previous worker pid, kill it, run another. looks like some kind of daemonization needed.

I'm sure we'll figure that out, but we won't be the first who did, so can you please add a section to the README?

bkeepers commented 13 years ago

@codesnik Definitely. Most people use god or some other process monitor in production. I think a deployment page in the wiki would be a great way to start.

Maay commented 13 years ago

Is it possible to use in capistrano deploy something like that? task :qu do run "cd #{deploy_to}/current/ && nuhup bundle exec rake qu:work QUEUES=urgent,default &" end

codesnik commented 13 years ago

it would work. but it won't restart worker if you changed it, and it would start worker on every deploy. looks like daemon-kit is needed for a robust solution.

Maay commented 13 years ago

Hm, I've tried and it does passing well, without errors, but Qu seems not starting and handling the jobs. It doesn't even create log file, but locally it does everything perfectly. What is the way to restart a worker?

codesnik commented 13 years ago

https://github.com/ddollar/foreman#readme maybe this could help.

bkeepers commented 13 years ago

@Maay, @codesnik: I would recommend managing the process server side. Either using god or foreman+upstart. See the Resque FAQ on restarting workers with capistrano.