我希望这是异步执行的
Map someotherMap = [{"10","dance"},{"2","stop"}]
Map resultMap = [:]
someotherMap.each { key, value ->
doSomethingThatsAddsToResultMap(key,value,resultMap)
}
然后我可以按照自己的意愿使用resultMap。
我试过了
Map resultMap = [:]
Map someotherMap = [{"10","dance"},{"2","stop"}]
GParsPool.withPool {
someotherMap.eachParallel { key,value ->
doSomethingThatsAddsToResultMap(key,value,resultMap)
}
}
任何想法我怎么能让这个工作?