This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in app/workers/testing_worker.rb | |
| class TestingWorker < Workling::Base | |
| def this_is_a_test(options) | |
| File.open(options[:id], "w") { |f| 1.upto(30) { f.write "."; f.flush; sleep(1) } } | |
| end | |
| end | |
| # in any controller... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :workling do | |
| namespace :client do | |
| desc "Starts workling client" | |
| task :start, :roles => :app, :only => { :primary => true } do | |
| run "sudo -u #{app_user} bash -c 'cd #{current_path} && export RAILS_ENV=#{rails_env} && ./script/workling_client stop'" | |
| run "sudo -u #{app_user} bash -c 'cd #{current_path} && rm -f log/workling.output'" | |
| run "sudo -u #{app_user} bash -c 'cd #{current_path} && export RAILS_ENV=#{rails_env} && ./script/workling_client start'" | |
| end | |
| desc "Stops workling client" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in app/workers/testing_worker.rb | |
| class TestingWorker < Workling::Base | |
| def this_is_a_test(options) | |
| File.open(options[:id], "w") { |f| 1.upto(30) { f.write "."; f.flush; sleep(1) } } | |
| end | |
| end | |
| # in any controller... |
NewerOlder