use of io.vertx.core.http.HttpServer in project vertx-openshift-it by cescoffier.
the class MapsVerticle method startHttpServer.
private Future<HttpServer> startHttpServer() {
Future<HttpServer> future = Future.future();
Router router = setupRouter();
vertx.createHttpServer().requestHandler(router::accept).listen(8080, future);
return future;
}
use of io.vertx.core.http.HttpServer in project vertx-openshift-it by cescoffier.
the class EventBusReceiverVerticle method startHttpServer.
private Future<HttpServer> startHttpServer() {
Future<HttpServer> future = Future.future();
Router router = setupRouter();
vertx.createHttpServer().requestHandler(router::accept).listen(8080, future);
return future;
}
use of io.vertx.core.http.HttpServer in project vertx-openshift-it by cescoffier.
the class EventBusVerticle method startHttpServer.
private Future<HttpServer> startHttpServer() {
List<Future> futures = new ArrayList<>();
futures.add(LocalPeerToPeer.createLocalPeerToPeer(vertx));
futures.add(DistributedPeerToPeer.createDistributedPeerToPeer(vertx));
futures.add(LocalPublish.createLocalPublish(vertx));
futures.add(DistributedPublish.createDistributedPublish(vertx));
futures.add(LocalRequestReply.createLocalRequestReply(vertx));
futures.add(DistributedRequestReply.createDistributedRequestReply(vertx));
futures.add(DistributedTimeout.createDistributedTimeout(vertx));
CompositeFuture allHandlers = CompositeFuture.all(futures);
return allHandlers.compose(cf -> {
Future<HttpServer> future = Future.future();
Router router = setupRouter(cf.list());
vertx.createHttpServer().requestHandler(router::accept).listen(8080, future);
return future;
});
}
use of io.vertx.core.http.HttpServer in project vertx-openshift-it by cescoffier.
the class LocksVerticle method startHttpServer.
private Future<HttpServer> startHttpServer() {
Future<HttpServer> future = Future.future();
Router router = setupRouter();
vertx.createHttpServer().requestHandler(router::accept).listen(8080, future);
return future;
}
use of io.vertx.core.http.HttpServer in project georocket by georocket.
the class GeoRocket method deployHttpServer.
/**
* Deploy the http server.
* @return a single that will complete when the http server was started.
*/
protected Single<HttpServer> deployHttpServer() {
String host = config().getString(ConfigConstants.HOST, ConfigConstants.DEFAULT_HOST);
int port = config().getInteger(ConfigConstants.PORT, ConfigConstants.DEFAULT_PORT);
Router router = createRouter();
HttpServerOptions serverOptions = createHttpServerOptions();
try {
HttpServer server = vertx.createHttpServer(serverOptions);
ObservableFuture<HttpServer> observable = RxHelper.observableFuture();
server.requestHandler(router::accept).listen(port, host, observable.toHandler());
return observable.toSingle();
} catch (Throwable t) {
return Single.error(t);
}
}
Aggregations