io.vertx.rxjava.core.AbstractVerticle Java Examples
The following examples show how to use
io.vertx.rxjava.core.AbstractVerticle.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CoreRxifiedApiTest.java From vertx-rx with Apache License 2.0 | 6 votes |
@Test public void testDeploy() throws Exception { AtomicInteger count = new AtomicInteger(); vertx.deployVerticle(new AbstractVerticle() { @Override public void start() throws Exception { HttpServer s1 = vertx.createHttpServer(new HttpServerOptions().setPort(8080)).requestHandler(req -> { }); HttpServer s2 = vertx.createHttpServer(new HttpServerOptions().setPort(8081)).requestHandler(req -> { }); Single<HttpServer> f1 = s1.rxListen(); Single<HttpServer> f2 = s2.rxListen(); Action1<HttpServer> done = server -> { if (count.incrementAndGet() == 2) { testComplete(); } }; f1.subscribe(done); f2.subscribe(done); } }); await(); }
Example #2
Source File: CoreApiTest.java From vertx-rx with Apache License 2.0 | 5 votes |
@Test public void testDeployVerticle() throws Exception { CountDownLatch deployLatch = new CountDownLatch(2); io.vertx.rxjava.core.RxHelper.deployVerticle(vertx, new AbstractVerticle() { @Override public void start() { deployLatch.countDown(); } }).subscribe(resp -> { deployLatch.countDown(); }); awaitLatch(deployLatch); }