如何运行Vertx API异步?

时间:2019-03-05 12:11:31

标签: multithreading api asynchronous vert.x

我尝试使用Vertx编写Web API以服务于大用户。

@Override
public Router router(Vertx vertx) {
Router router = Router.router(vertx);
router.route().handler(BodyHandler.create());
router.post("/").handler(this::productionF);
return router;
}

private void productionF(RoutingContext routingContext) {
  // check input
  // read data from redis
  // response
}

但是,现在,我想将此API移到异步过程中以获得高性能。我尝试使用EventBus,但不起作用。

有人对此有任何想法或实验吗?

0 个答案:

没有答案