本文整理了Java中org.rapidoid.job.Jobs.execute()
方法的一些代码示例,展示了Jobs.execute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jobs.execute()
方法的具体详情如下:
包路径:org.rapidoid.job.Jobs
类名称:Jobs
方法名:execute
暂无
代码示例来源:origin: rapidoid/rapidoid
public static <T> void execute(Callable<T> job, Callback<T> callback) {
execute(callbackJob(job, callback));
}
代码示例来源:origin: rapidoid/rapidoid
public static <T> void call(Callback<T> callback, T result, Throwable error) {
Jobs.execute(new CallbackExecutorJob<>(callback, result, error));
}
代码示例来源:origin: rapidoid/rapidoid
Jobs.execute(new Runnable() {
@Override
public void run() {
代码示例来源:origin: rapidoid/rapidoid
HttpStatus errorAndDone(final Req req, final Throwable error, final LogLevel logLevel) {
req.revert();
req.async();
Runnable errorHandler = () -> {
error(req, error, logLevel);
// the Req object will do the rendering
req.done();
};
Ctx ctx = Ctxs.get();
if (ctx == null) {
With.exchange(req).run(errorHandler);
} else {
Jobs.execute(errorHandler);
}
return HttpStatus.ASYNC;
}
代码示例来源:origin: org.rapidoid/rapidoid-db-hibernate
@Override
public void transaction(final Runnable tx, final boolean readonly, final Callback<Void> callback) {
Jobs.execute(new Callable<Void>() {
@Override
public Void call() throws Exception {
transaction(tx, readonly);
return null;
}
}, callback);
}
代码示例来源:origin: org.rapidoid/rapidoid-ctx
public static <T> void callIfNotNull(Callback<T> callback, T result, Throwable error) {
if (callback != null) {
Jobs.execute(new CallbackExecutorJob<T>(callback, result, error));
}
}
代码示例来源:origin: org.rapidoid/rapidoid-http
@Override
public HTTPServer start() {
super.start();
Jobs.execute(new Runnable() {
@Override
public void run() {
JSON.warmup();
}
});
return this;
}
代码示例来源:origin: org.rapidoid/rapidoid-ctx
public static <T> void execute(Callable<T> job, Callback<T> callback) {
execute(callbackJob(job, callback));
}
代码示例来源:origin: org.rapidoid/rapidoid-ctx
public static <T> void call(Callback<T> callback, T result, Throwable error) {
Jobs.execute(new CallbackExecutorJob<T>(callback, result, error));
}
代码示例来源:origin: org.rapidoid/rapidoid-ctx
public static synchronized void executeInCtx(String tag, Runnable action) {
Ctxs.open(tag);
try {
Jobs.execute(action);
} finally {
Ctxs.close();
}
}
代码示例来源:origin: org.rapidoid/rapidoid-http-fast
HttpStatus errorAndDone(final Req req, final Throwable error, final LogLevel logLevel) {
req.revert();
req.async();
Runnable errorHandler = new Runnable() {
@Override
public void run() {
error(req, error, logLevel);
// the Req object will do the rendering
req.done();
}
};
Ctx ctx = Ctxs.get();
if (ctx == null) {
With.exchange(req).run(errorHandler);
} else {
Jobs.execute(errorHandler);
}
return HttpStatus.ASYNC;
}
内容来源于网络,如有侵权,请联系作者删除!