use of io.vertx.up.micro.ipc.server.Tunnel in project vertx-zero by silentbalanceyh.
the class ZeroRpcAgent method start.
@Override
public void start() {
/**
* 1. Iterate all the configuration *
*/
Fn.itMap(ZeroAtomic.RPC_OPTS, (port, config) -> {
/**
* 2.Rcp server builder initialized *
*/
final VertxServerBuilder builder = VertxServerBuilder.forAddress(this.vertx, config.getHost(), config.getPort());
/**
* 3.Service added.
*/
{
// UnityService add ( Envelop )
final Tunnel tunnel = Instance.singleton(UnityTunnel.class);
builder.addService(tunnel.init(this.vertx));
}
/**
* 4.Server added.
*/
final VertxServer server = builder.build();
server.start(handler -> this.registryServer(handler, config));
});
}
Aggregations