lib/wmap/url_checker.rb
# Parallel scanner - by utilizing fork manager 'parallel' to spawn numbers of child processes on multiple urls simultaneously
Parallel scanner - by utilizing fork manager 'parallel' to spawn numbers of child processes on multiple urls simultaneously
Parallel scanner - by utilizing fork manager ' parallel ' to spawn numbers of child processes on multiple urls simultaneously
def url_workers (targets,num=@max_parallel)
		results=Array.new
		targets -= ["", nil]
		if targets.size > 0
			puts "Start the url checker on the targets:\n #{targets}"
			Parallel.map(targets, :in_processes => num) { |target|
				url_worker(target)
			}.each do |process|
				if process.nil?
					next
				elsif process.empty?
				else
					results << process
				end
			end
		end
		return results
	rescue Exception => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
		return nil
	end
def url_workers ( targets , num = @max_parallel ) results = Array . new targets -= [ "" , nil ] if targets . size > 0 puts "Start the url checker on the targets:\n #{targets}" Parallel . map ( targets , :in_processes => num ) { | target | url_worker ( target ) } . each do | process | if process . nil? next elsif process . empty? else results << process end end end return results rescue Exception => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return nil end
Parallel scanner - by utilizing fork manager 'parallel' to spawn numbers of child processes on multiple urls simultaneously
Parallel scanner - by utilizing fork manager ' parallel ' to spawn numbers of child processes on multiple urls simultaneously
#do nothing
targets
<not_specific>
num
<not_specific>