io.vertx.reactivex.core.AbstractVerticle Java Examples
The following examples show how to use
io.vertx.reactivex.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: RxVertxTestBase.java From graviteeio-access-management with Apache License 2.0 | 5 votes |
/** * Create a worker verticle for the current Vert.x and return its context. * * @return the context * @throws Exception anything preventing the creation of the worker */ protected String createWorker() throws Exception { CompletableFuture<String> fut = new CompletableFuture<>(); vertx.deployVerticle(AbstractVerticle.class.getName(), new DeploymentOptions().setWorker(true), ar -> { if (ar.failed()) { fut.completeExceptionally(ar.cause()); } else { fut.complete(ar.result()); } }); return fut.get(); }
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); RxHelper.deployVerticle(vertx, new AbstractVerticle() { @Override public void start() { deployLatch.countDown(); } }).subscribe(resp -> { deployLatch.countDown(); }); awaitLatch(deployLatch); }