I have a loop:
Dir.new("#{RAILS_ROOT}/public/images/vehicles/uploaded/
#{@vehicle.id}").each do |image|
if image =~ /.*\.jpg$/i
@vehicle_image = VehicleImage.new()
@vehicle.vehicle_images << @vehicle_image
File.cp("#{RAILS_ROOT}/public/images/vehicles/uploaded/
#{@vehicle.id}/#{image}", "#{RAILS_ROOT}/public/images/vehicles/
original/#{@vehicle_image.id}.jpg")
MiddleMan.new_worker(:class => :resizeimage_worker, :args =>
{:id => @vehicle_image.id, :basepath => "#{RAILS_ROOT}/public/images/
vehicles/"})
end
end
It appears to be waiting for MiddleMan.new_worker to return before
continuing to the next iteration.
Im sure I must be doing something wrong here - as this would defeat
the whole point of backgroundrb?
Any thoughts?
Kind Regards,
Matt Williams
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
http://rubyforge.org/pipermail/backgroundrb-devel/2007-March/000790.html may be of help to you. -- Roderick van Domburg http://www.nedforce.nl -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank you kindly for the quick reply. It turns out I spawning new workers for each image, each of which consumed crazy amounts of resources and gave the illusion of blocking as the system was running so slow --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
heh........that would do it! :p On 7/15/07, Matt <matt-5JC3FsxXPsVpLGFMi4vTTA@public.gmane.org> wrote:> > > Thank you kindly for the quick reply. > > It turns out I spawning new workers for each image, each of which > consumed crazy amounts of resources and gave the illusion of blocking > as the system was running so slow > > > > >-- -------------------- seth at subimage interactive ----- http://sublog.subimage.com ----- Cashboard - Estimates, invoices, and time tracking software - for free! http://www.getcashboard.com ----- Substruct - Open source RoR e-commerce software. http://dev.subimage.com/projects/substruct --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---