I have a BackgrounDRb worker set up to run its 'sync' method every 15 minutes. Then, say, I want to run the method once just now. I was trying to wrap that in a rake task as follows:
namespace :mytasks do
task :sync do |t|
worker = MiddleMan.worker(:my_worker)
worker.async_sync
end
end
But this doesn't work. It bails out with all sorts of undefined constants and so on. None of my tries to require misc. gems produced a runnable rake task. :(
So, the question is how do you trigger a BackgrounDRb task from within a rake task?