限制事件循环的数量
Limit the number of event loops
在vertx docs中,他们提到可以限制每个顶点实例的事件循环线程数:
Instead of a single event loop, each Vertx instance maintains several event loops. By default we choose the number based on the number of available cores on the machine, but this can be overridden.
也许有人知道该怎么做? (我需要它用于调试目的)
Vertx vertx = Vertx.vertx(new VertxOptions().setEventLoopPoolSize(1));
默认为:
public static final int DEFAULT_EVENT_LOOP_POOL_SIZE = 2 * Runtime.getRuntime().availableProcessors();
在vertx docs中,他们提到可以限制每个顶点实例的事件循环线程数:
Instead of a single event loop, each Vertx instance maintains several event loops. By default we choose the number based on the number of available cores on the machine, but this can be overridden.
也许有人知道该怎么做? (我需要它用于调试目的)
Vertx vertx = Vertx.vertx(new VertxOptions().setEventLoopPoolSize(1));
默认为:
public static final int DEFAULT_EVENT_LOOP_POOL_SIZE = 2 * Runtime.getRuntime().availableProcessors();