use of io.vertx.core.ClusterOptions in project vertx-zero by silentbalanceyh.
the class Motor method start.
public static <T> void start(final Class<?> clazz, final Consumer<T> consumer, final Consumer<Consumer<T>> fnSingle, final BiConsumer<ClusterManager, Consumer<T>> fnCluster, final Annal logger) {
if (null == consumer) {
throw new VertxCallbackException(clazz);
}
// 1. Check if clustered mode
final ClusterOptions cluster = ZeroGrid.getClusterOption();
if (cluster.isEnabled()) {
// 2.1. Clustered
final ClusterManager manager = cluster.getManager();
logger.info(Info.APP_CLUSTERD, manager.getClass().getName(), manager.getNodeID(), manager.isActive());
fnCluster.accept(manager, consumer);
} else {
// 2.2. Standalone
fnSingle.accept(consumer);
}
}
Aggregations