本文整理了Java中org.nutz.lang.Lang.quiteSleep()
方法的一些代码示例,展示了Lang.quiteSleep()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lang.quiteSleep()
方法的具体详情如下:
包路径:org.nutz.lang.Lang
类名称:Lang
方法名:quiteSleep
[英]对Thread.sleep(long)的简单封装,不抛出任何异常
[中]对线睡眠(长)的简单封装,不抛出任何异常
代码示例来源:origin: nutzam/nutzboot
public static void fromRemote(PropertiesProxy conf, String fileName) {
for (int i = 0; i < 5; i++) {
for (String host : props.hosts) {
boolean re = bySimple(conf, host, fileName);
if (re)
return;
Lang.quiteSleep(1000);
}
}
throw new RuntimeException("can't fetch config from remote : " + fileName);
}
代码示例来源:origin: nutzam/nutz-web
public static boolean replyByXHR(HttpServletResponse resp, String respTxt, long sleepTime) {
Writer wr = null;
OutputStream out = null;
try {
out = resp.getOutputStream();
wr = new OutputStreamWriter(out);
String data = respTxt;
// log.debugf("Comet-Send By XHR : [%s]", respTxt);
wr.write(data);
wr.flush();
Lang.quiteSleep(1 * sleepTime);
}
catch (IOException e) {
log.warn("Comet-Send Has Stoped");
return false;
}
return true;
}
代码示例来源:origin: nutzam/nutzboot
@Override
public void run() {
try {
while (keepRun) {
Lang.quiteSleep(loglevelProperty.getHeartbeat() * 1000);
loglevelService.saveToRedis();
}
} catch (Throwable e) {
log.debug("something happen!!!", e);
}
}
代码示例来源:origin: nutzam/nutzboot
int delay = conf.getInt("actuator.uplink.delay", 5000);
if (delay > 0)
Lang.quiteSleep(delay);
try {
while (keepRun) {
内容来源于网络,如有侵权,请联系作者删除!