本文整理了Java中io.vertx.core.VertxOptions.setMaxEventLoopExecuteTime()
方法的一些代码示例,展示了VertxOptions.setMaxEventLoopExecuteTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VertxOptions.setMaxEventLoopExecuteTime()
方法的具体详情如下:
包路径:io.vertx.core.VertxOptions
类名称:VertxOptions
方法名:setMaxEventLoopExecuteTime
[英]Sets the value of max event loop execute time, in VertxOptions#setMaxEventLoopExecuteTimeUnit.
The default value of VertxOptions#setMaxEventLoopExecuteTimeUnitis TimeUnit#NANOSECONDS
[中]设置最大事件循环执行时间的值,单位为VertxOptions#setMaxEventLoopExecuteTimeUnit。
VertxOptions的默认值#setMaxEventLoopExecuteTimeUnitis时间单位#纳秒
代码示例来源:origin: eclipse-vertx/vert.x
case "maxEventLoopExecuteTime":
if (member.getValue() instanceof Number) {
obj.setMaxEventLoopExecuteTime(((Number)member.getValue()).longValue());
代码示例来源:origin: stackoverflow.com
VertxOptions options = new VertxOptions();
options.setMaxEventLoopExecuteTime(Long.MAX_VALUE);
vertx = Vertx.vertx(options);`
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testBlockCheckExceptionTimeLimit() throws Exception {
Verticle verticle = new AbstractVerticle() {
@Override
public void start() throws InterruptedException {
Thread.sleep(3000);
testComplete();
}
};
// set warning threshold to 1s and the exception threshold as well
long maxEventLoopExecuteTime = 1;
TimeUnit maxEventLoopExecuteTimeUnit = SECONDS;
VertxOptions vertxOptions = new VertxOptions();
vertxOptions.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime);
vertxOptions.setMaxEventLoopExecuteTimeUnit(maxEventLoopExecuteTimeUnit);
vertxOptions.setWarningExceptionTime(maxEventLoopExecuteTime);
vertxOptions.setWarningExceptionTimeUnit(maxEventLoopExecuteTimeUnit);
Vertx newVertx = vertx(vertxOptions);
newVertx.deployVerticle(verticle);
await();
blockedThreadWarning.expectMessage("vert.x-eventloop-thread", maxEventLoopExecuteTime, maxEventLoopExecuteTimeUnit);
}
代码示例来源:origin: codingchili/excelastic
private ApplicationLauncher(String[] args) {
VertxOptions options = new VertxOptions();
options.setMaxWorkerExecuteTime(options.getMaxWorkerExecuteTime() * 20) // 20 minutes.
.setMaxEventLoopExecuteTime(options.getMaxEventLoopExecuteTime() * 10) // 10 seconds.
.setBlockedThreadCheckInterval(8000);
vertx = Vertx.vertx();
ImportEventCodec.registerOn(vertx);
logger.startupMessage();
start().setHandler(done -> {
if (done.succeeded()) {
logger.applicationStartup();
if (args.length > 1) {
// import file from the command line.
new CommandLine(vertx, args);
} else {
// wait for the elasticsearch server to come online to show the import UI.
waitForElasticServerAvailability();
}
} else {
logger.applicationStartupFailure(done.cause());
vertx.close();
}
});
}
代码示例来源:origin: eclipse-vertx/vert.x
options.setClusterPingInterval(clusterPingInterval);
options.setClusterPingReplyInterval(clusterPingReplyInterval);
options.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime);
options.setMaxWorkerExecuteTime(maxWorkerExecuteTime);
options.setHAEnabled(haEnabled);
代码示例来源:origin: eclipse/hono
/**
* Configures the Vert.x options based on this object's property values.
*
* @param options The options to configure.
* @return The (updated) options.
*/
public VertxOptions configureVertx(final VertxOptions options) {
options.setPreferNativeTransport(this.preferNative);
if (this.enableMetrics) {
options.setMetricsOptions(new MetricsOptions().setEnabled(true));
}
options.setMaxEventLoopExecuteTime(maxEventLoopExecuteTimeMillis * 1000000L);
options.setWarningExceptionTime(maxEventLoopExecuteTimeMillis * 1500000L);
options.setAddressResolverOptions(new AddressResolverOptions()
.setCacheNegativeTimeToLive(0) // discard failed DNS lookup results immediately
.setCacheMaxTimeToLive(0) // support DNS based service resolution
.setQueryTimeout(dnsQueryTimeout));
return options;
}
代码示例来源:origin: io.vertx/vertx-core
case "maxEventLoopExecuteTime":
if (member.getValue() instanceof Number) {
obj.setMaxEventLoopExecuteTime(((Number)member.getValue()).longValue());
代码示例来源:origin: org.amv.vertx/amv-vertx-spring-boot-starter
@ConditionalOnMissingBean(VertxOptions.class)
@Bean
public VertxOptions vertxOptions(EventBusOptions eventBusOptions, MetricsOptions metricsOptions) {
return new VertxOptions()
.setBlockedThreadCheckInterval(properties.getBlockedThreadCheckInterval())
.setEventLoopPoolSize(properties.getEventLoopPoolSize())
.setWorkerPoolSize(properties.getWorkerPoolSize())
.setInternalBlockingPoolSize(properties.getInternalBlockingPoolSize())
.setQuorumSize(properties.getQuorumSize())
.setMaxEventLoopExecuteTime(properties.getMaxEventLoopExecuteTime())
.setHAGroup(properties.getHaGroup())
.setMaxWorkerExecuteTime(properties.getMaxWorkerExecuteTime())
.setWarningExceptionTime(properties.getWarningExceptionTime())
.setFileResolverCachingEnabled(properties.isFileResolverCachingEnabled())
.setHAEnabled(properties.isHaEnabled())
.setEventBusOptions(eventBusOptions)
.setMetricsOptions(metricsOptions);
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testBlockCheckExceptionTimeLimit() throws Exception {
Verticle verticle = new AbstractVerticle() {
@Override
public void start() throws InterruptedException {
Thread.sleep(3000);
testComplete();
}
};
// set warning threshold to 1s and the exception threshold as well
long maxEventLoopExecuteTime = 1;
TimeUnit maxEventLoopExecuteTimeUnit = SECONDS;
VertxOptions vertxOptions = new VertxOptions();
vertxOptions.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime);
vertxOptions.setMaxEventLoopExecuteTimeUnit(maxEventLoopExecuteTimeUnit);
vertxOptions.setWarningExceptionTime(maxEventLoopExecuteTime);
vertxOptions.setWarningExceptionTimeUnit(maxEventLoopExecuteTimeUnit);
Vertx newVertx = vertx(vertxOptions);
newVertx.deployVerticle(verticle);
await();
blockedThreadWarning.expectMessage("vert.x-eventloop-thread", maxEventLoopExecuteTime, maxEventLoopExecuteTimeUnit);
}
代码示例来源:origin: eclipse-vertx/vert.x
assertEquals(options, options.setMaxEventLoopExecuteTime(rand));
assertEquals(rand, options.getMaxEventLoopExecuteTime());
try {
options.setMaxEventLoopExecuteTime(0);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
代码示例来源:origin: io.vertx/vertx-core
options.setClusterPingInterval(clusterPingInterval);
options.setClusterPingReplyInterval(clusterPingReplyInterval);
options.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime);
options.setMaxWorkerExecuteTime(maxWorkerExecuteTime);
options.setHAEnabled(haEnabled);
代码示例来源:origin: io.vertx/vertx-core
assertEquals(options, options.setMaxEventLoopExecuteTime(rand));
assertEquals(rand, options.getMaxEventLoopExecuteTime());
try {
options.setMaxEventLoopExecuteTime(0);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
内容来源于网络,如有侵权,请联系作者删除!