Multi-Threading erhält tiefere Informationen über mehrere Transaktionen
function main() { var depths = []; while (true) { for (var i = 0; i < exchanges.length; i++) { if (depths[i] == null) { // 创建异步操作 depths[i] = exchanges[i].Go("GetDepth"); } } var failed = 0; for (var i = 0; i < exchanges.length; i++) { if (typeof(depths[i].wait) != "undefined") { // 等待结果 var ret = depths[i].wait(); if (ret) { depths[i] = ret; Log(exchanges[i].GetName(), depths[i]); } else { // 重试 depths[i] = null; failed++; } } } if (failed == 0) { break; } else { Sleep(100); } } }