Sha256: bda3b21cf07f9c328c7a133141d8b1d89b677a28ab2d589843969b2efd1d0882
Contents?: true
Size: 636 Bytes
Versions: 1
Compression:
Stored size: 636 Bytes
Contents
require 'thread' require 'asakra/each' require 'asakra/judge' module Asakra class Batch def start agentsFile = open("setting/agents.txt") agentsList = [] agentsFile.each {|e| agentsList.push(e) } myListener = Asakra::MyListener.new() judge = Asakra::Judge.new(myListener) judge.setting m = Mutex.new ts = [] ts << Thread.start { m.synchronize { for e in agentsList each = Asakra::Each.new(e, judge) each.run sleep rand * 0.1 end } } ts.each {|t| t.join } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
asakra-0.0.4-java | lib/asakra/batch.rb |