use of io.vertx.up.rs.Axis in project vertx-zero by silentbalanceyh.
the class ZeroRxAgent method start.
@Override
public void start() {
/**
* 1.Call router hub to mount commont *
*/
final Axis<Router> routerAxiser = Fn.poolThread(Pool.ROUTERS, () -> Instance.instance(RouterAxis.class));
/**
* 2.Call route hub to mount defined *
*/
final Axis<Router> axiser = Fn.poolThread(Pool.EVENTS, () -> Instance.instance(EventAxis.class));
/**
* 3.Get the default HttpServer Options *
*/
ZeroAtomic.RX_OPTS.forEach((port, option) -> {
/**
* 3.1.Single server processing *
*/
final HttpServer server = this.vertx.createHttpServer(option);
/**
* 3.2. Build router with current option *
*/
final Router router = Router.router(this.vertx);
routerAxiser.mount(router);
axiser.mount(router);
/**
* 3.3. Listen for router on the server *
*/
final Single<HttpServer> result = server.requestHandler(router::accept).rxListen();
/**
* 3.4. Log output *
*/
{
result.subscribe((rxServer) -> {
recordServer(option, router);
});
}
});
}
use of io.vertx.up.rs.Axis in project vertx-zero by silentbalanceyh.
the class WebBase method start.
@SuppressWarnings("unchecked")
protected void start() {
/**
* 1.Get the default HttpServer Options *
*/
SERVERS.forEach((port, option) -> {
/**
* 4.Call router hub to mount commont *
*/
Axis huber = Instance.singleton(RouterAxis.class);
huber.mount(this.router);
/**
* 5.Call route hub to mount defined *
*/
huber = Instance.singleton(EventAxis.class);
huber.mount(this.router);
});
}
Aggregations