scheduling inside spawn method

0 views
Skip to first unread message

sup

unread,
May 14, 2008, 9:01:32 AM5/14/08
to DeRailed - Denver Rails UG
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!!

Tom Anderson

unread,
May 16, 2008, 3:23:39 PM5/16/08
to dera...@googlegroups.com
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 all
Reply to author
Forward
0 new messages