Threads code. Just 1 at this time. Yes i know.

git-svn-id: file:///home/svn/framework3/trunk@8864 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
et 2010-03-21 03:39:09 +00:00
parent 0bb34c94be
commit 0c17f3d9cb
1 changed files with 12 additions and 11 deletions

View File

@ -158,10 +158,10 @@ class HttpCrawler
puts "URI not crawled #{hashreq['uri']}"
else
#if i < $threadnum
# a.push(Thread.new {
####
if i < $threadnum
a.push(Thread.new {
####
prx = nil
if self.useproxy
prx = "HTTP:"+self.proxyhost.to_s+":"+self.proxyport.to_s
@ -179,14 +179,15 @@ class HttpCrawler
sendreq(c,hashreq)
####
})
# })
# i += 1
#else
# sleep(0.01) and a.delete_if {|x| not x.alive?} while not a.empty?
# i = 0
#end
i += 1
else
sleep(0.01) and a.delete_if {|x| not x.alive?} while not a.empty?
i = 0
end
####
end
else
#puts "#{hashreq} already visited at #{@ViewedQueue[hashsig(hashreq)]}"