On Sat, 2007-12-29 at 17:32 +0100, Jim Neath wrote:> 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 })
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---