如何为主 Verticle 设置 DeploymentOptions
how can I set DeploymentOptions for main verticle
如何设置
DeploymentOptions options = new DeploymentOptions().setWorker(true);
主垂直?
我需要类似的东西
@Override
public void init(Vertx vertx, Context context) {
// TODO Auto-generated method stub
super.init(vertx, context);
}
如果您手动部署 Verticle,那么您可以只使用 DeploymentOptions
:
DeploymentOptions options = new DeploymentOptions();
// <options configuration>
vertx.deployVerticle("com.mycompany.MyVerticle", options);
如果你使用vertx command line tool,那么vertx run
命令可以带几个可选参数。对于你的问题,-worker
选项决定了verticle是否是worker verticle。
如果你使用Vert.xLauncher class, then you can inherit from it and customize some hook methods from VertxLifecycleHooks接口。
如何设置
DeploymentOptions options = new DeploymentOptions().setWorker(true);
主垂直?
我需要类似的东西
@Override
public void init(Vertx vertx, Context context) {
// TODO Auto-generated method stub
super.init(vertx, context);
}
如果您手动部署 Verticle,那么您可以只使用
DeploymentOptions
:DeploymentOptions options = new DeploymentOptions(); // <options configuration> vertx.deployVerticle("com.mycompany.MyVerticle", options);
如果你使用vertx command line tool,那么
vertx run
命令可以带几个可选参数。对于你的问题,-worker
选项决定了verticle是否是worker verticle。如果你使用Vert.xLauncher class, then you can inherit from it and customize some hook methods from VertxLifecycleHooks接口。