org.rapidoid.job.Jobs.execute()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.rapidoid.job.Jobs.execute()方法的一些代码示例,展示了Jobs.execute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jobs.execute()方法的具体详情如下:
包路径:org.rapidoid.job.Jobs
类名称:Jobs
方法名:execute

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;
}

相关文章