示例代码
var Orderbook = function (name) {
return new Promise(function (resolve, reject) {
bitmanager.getorderbook({ market: name, type: 'sell' }, function (data, err) {
if (err) {
sleep(2000, name).then(() => {
console.error("failed .... go back");
return Orderbook(name);// console.error(err);
});
}else
resolve(data.result);
});
});
};