BackgroundRB - Confused

Hi guys,

I’ve been following this article but it seems that the version of
backgroundrb being used is out of date. So I’ve updated to the newer
version.

Can anyone tell me what is wrong with the following:

===

class VideoConversionWorker < BackgrounDRb::MetaWorker
set_worker_name :video_conversion_worker
def create(args = nil)
logger.info(“Entered VideoConversionWorker.”)
video_id = args[:video_id]
video_file = args[:absolute_path]
video = Video.find(video_id)
logger.info("File: " + video_file)
logger.info("Video id: " + video_id)
video.convert_to_flv
logger.info(“done worker code”)
end
end

===

I’m calling it via the following line:

===

MiddleMan.new_worker(:worker => :video_conversion_worker, :job_key =>
“video” + self.id.to_s, :args => { :absolute_path => self.full_filename,
:video_id => self.id.to_s })

Any ideas?

On Sat, 2007-12-29 at 17:32 +0100, Jim N. wrote:

class VideoConversionWorker < BackgrounDRb::MetaWorker
end
:video_id => self.id.to_s })
Ok new worker code will look like:

class VideoConversionWorker < BackgrounDRb::MetaWorker
set_worker_name :video_conversion_worker
set_no_auto_load true
def create(args = nil)
logger.info(“Entered VideoConversionWorker.”)
video_id = args[:video_id]
video_file = args[:absolute_path]
video = Video.find(video_id)
logger.info("File: " + video_file)
logger.info("Video id: " + video_id)
video.convert_to_flv
logger.info(“done worker code”)
end
end

MiddleMan.new_worker(:worker => :video_conversion_worker, :job_key =>
“video” + self.id.to_s, :data => { :absolute_path => self.full_filename,
:video_id => self.id.to_s })

That’s about it. If you have any further problems, please ask on:

http://rubyforge.org/mailman/listinfo/backgroundrb-devel

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs