Forum: Ruby on Rails Backgroundrb not detaching

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matt (Guest)
on 2007-07-13 15:06
(Received via mailing list)
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
Roderick v. (Guest)
on 2007-07-14 13:01
http://rubyforge.org/pipermail/backgroundrb-devel/...
may be of help to you.

--
Roderick van Domburg
http://www.nedforce.nl
Matt (Guest)
on 2007-07-15 23:39
(Received via mailing list)
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 b. (Guest)
on 2007-07-16 07:33
(Received via mailing list)
heh........that would do it! :p

On 7/15/07, Matt <removed_email_address@domain.invalid> wrote:
>
--
--------------------
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
This topic is locked and can not be replied to.