本文整理了Java中io.vertx.core.VertxOptions.setClusterPingReplyInterval()
方法的一些代码示例,展示了VertxOptions.setClusterPingReplyInterval()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VertxOptions.setClusterPingReplyInterval()
方法的具体详情如下:
包路径:io.vertx.core.VertxOptions
类名称:VertxOptions
方法名:setClusterPingReplyInterval
[英]Set the value of cluster ping reply interval, in ms.
[中]设置集群ping应答间隔的值,以毫秒为单位。
代码示例来源:origin: eclipse-vertx/vert.x
case "clusterPingReplyInterval":
if (member.getValue() instanceof Number) {
obj.setClusterPingReplyInterval(((Number)member.getValue()).longValue());
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testClusteredPong() throws Exception {
startNodes(2, new VertxOptions().setClusterPingInterval(500).setClusterPingReplyInterval(500));
AtomicBoolean sending = new AtomicBoolean();
MessageConsumer<String> consumer = vertices[0].eventBus().<String>consumer("foobar").handler(msg -> {
if (!sending.get()) {
sending.set(true);
vertx.setTimer(4000, id -> {
vertices[1].eventBus().send("foobar", "whatever2");
});
} else {
testComplete();
}
});
consumer.completionHandler(ar -> {
assertTrue(ar.succeeded());
vertices[1].eventBus().send("foobar", "whatever");
});
await();
}
代码示例来源:origin: io.vertx/vertx-core
case "clusterPingReplyInterval":
if (member.getValue() instanceof Number) {
obj.setClusterPingReplyInterval(((Number)member.getValue()).longValue());
代码示例来源:origin: eclipse-vertx/vert.x
options.setClusterPublicHost(clusterPublicHost);
options.setClusterPingInterval(clusterPingInterval);
options.setClusterPingReplyInterval(clusterPingReplyInterval);
options.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime);
options.setMaxWorkerExecuteTime(maxWorkerExecuteTime);
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testClusteredPong() throws Exception {
startNodes(2, new VertxOptions().setClusterPingInterval(500).setClusterPingReplyInterval(500));
AtomicBoolean sending = new AtomicBoolean();
MessageConsumer<String> consumer = vertices[0].eventBus().<String>consumer("foobar").handler(msg -> {
if (!sending.get()) {
sending.set(true);
vertx.setTimer(4000, id -> {
vertices[1].eventBus().send("foobar", "whatever2");
});
} else {
testComplete();
}
});
consumer.completionHandler(ar -> {
assertTrue(ar.succeeded());
vertices[1].eventBus().send("foobar", "whatever");
});
await();
}
代码示例来源:origin: eclipse-vertx/vert.x
assertEquals(options, options.setClusterPingReplyInterval(randomLong));
assertEquals(randomLong, options.getClusterPingReplyInterval());
try {
options.setClusterPingReplyInterval(-1);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
代码示例来源:origin: io.vertx/vertx-core
options.setClusterPublicHost(clusterPublicHost);
options.setClusterPingInterval(clusterPingInterval);
options.setClusterPingReplyInterval(clusterPingReplyInterval);
options.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime);
options.setMaxWorkerExecuteTime(maxWorkerExecuteTime);
代码示例来源:origin: io.vertx/vertx-core
assertEquals(options, options.setClusterPingReplyInterval(randomLong));
assertEquals(randomLong, options.getClusterPingReplyInterval());
try {
options.setClusterPingReplyInterval(-1);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
内容来源于网络,如有侵权,请联系作者删除!