I am using multi Threading concept to optimize performance of long array which takes long time to do action with every element. I used .peach in my code require ''peach'' def fr_display @graph = Koala::Facebook::GraphAPI.new(session[:fbuser] ["credentials"]["token"]) @friends = @graph.get_connections("me", "friends") @img=Array.new(@friends.size) i=1 @friends.peach do |friend| begin @img[i]=self.get_fb_image(friend[''id''],friend[''name'']) rescue StandardError => e @img[i]=""; end i=i+1 end end but in heroku deployment it is not running and showing error in error log that New Thread is unable to create. any solution to work with Multi threading in rails 3 heroku project or optimize performance without using multi threading. Thank You in advance -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This is what background workers are good for. On heroku your choices are delayed job and resque (which I prefer) or you might want to use simpleworker.com, which is a great solution and scales better. On Mon, Sep 19, 2011 at 5:41 AM, subbarao <subbarao.kly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am using multi Threading concept to optimize performance of long > array which takes long time to do action with every element. I > used .peach in my code > > require ''peach'' > def fr_display > @graph = Koala::Facebook::GraphAPI.new(session[:fbuser] > ["credentials"]["token"]) > > @friends = @graph.get_connections("me", "friends") > @img=Array.new(@friends.size) > i=1 > @friends.peach do |friend| > begin > @img[i]=self.get_fb_image(friend[''id''],friend[''name'']) > rescue StandardError => e > @img[i]=""; > end > i=i+1 > end > > end > > but in heroku deployment it is not running and showing error in error > log that New Thread is unable to create. > > any solution to work with Multi threading in rails 3 heroku project or > optimize performance without using multi threading. > > Thank You in advance > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank You for your valuable submission. I will follow the document of simpleworker.com <http://simpleworker.com> and try. On Monday 19 September 2011 06:13 PM, Martin Wawrusch wrote:> This is what background workers are good for. On heroku your choices > are delayed job and resque (which I prefer) or you might want to use > simpleworker.com <http://simpleworker.com>, which is a great solution > and scales better. > > On Mon, Sep 19, 2011 at 5:41 AM, subbarao <subbarao.kly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > <mailto:subbarao.kly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote: > > I am using multi Threading concept to optimize performance of long > array which takes long time to do action with every element. I > used .peach in my code > > require ''peach'' > def fr_display > @graph = Koala::Facebook::GraphAPI.new(session[:fbuser] > ["credentials"]["token"]) > > @friends = @graph.get_connections("me", "friends") > @img=Array.new(@friends.size) > i=1 > @friends.peach do |friend| > begin > @img[i]=self.get_fb_image(friend[''id''],friend[''name'']) > rescue StandardError => e > @img[i]=""; > end > i=i+1 > end > > end > > but in heroku deployment it is not running and showing error in error > log that New Thread is unable to create. > > any solution to work with Multi threading in rails 3 heroku project or > optimize performance without using multi threading. > > Thank You in advance > > -- > 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 > <mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > <mailto:rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.