Google Groups Home
Help | Sign in
scheduling inside spawn method
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
sup  
View profile
 More options May 14, 9:01 am
From: sup <supriya.ii...@gmail.com>
Date: Wed, 14 May 2008 06:01:32 -0700 (PDT)
Local: Wed, May 14 2008 9:01 am
Subject: scheduling inside spawn method
Hello, what i ve been trying to achieve is pinging all ipaddress
present in my database periodically.
So i tried using spawn(:method=>thread) since im on windows.
its working fine but its working well with scheduling.
 my code is like this:

def index
spawn(:method=>:thread) do

   scheduler = Scheduler.new
      scheduler.start

      scheduler.schedule_every('1s') {ping_ip_addr}

    scheduler.join

   end
end

and if i try using sleep with spawn then it pings only first ip
address presnet in database.
 please help!!

thanking in advance!!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Anderson  
View profile
 More options May 16, 3:23 pm
From: "Tom Anderson" <tom.4nder...@gmail.com>
Date: Fri, 16 May 2008 13:23:39 -0600
Local: Fri, May 16 2008 3:23 pm
Subject: Re: scheduling inside spawn method

I'm not familiar with the Scheduler stuff you're using but I suspect your
problem is with that.   Put some debug around that and I would guess you'll
see it exiting the spawn block immediately which may not be what you want.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google