Search in sources :

Example 1 with ServerPipesConfig

use of com.ociweb.pronghorn.network.ServerPipesConfig in project GreenLightning by oci-pronghorn.

the class MsgRuntime method buildGraphForServer.

private void buildGraphForServer(MsgApp app) {
    HTTPServerConfig config = builder.getHTTPServerConfig();
    ServerPipesConfig serverConfig = config.buildServerConfig(builder.parallelTracks());
    ServerCoordinator serverCoord = new ServerCoordinator(config.getCertificates(), config.bindHost(), config.bindPort(), serverConfig.maxConnectionBitsOnServer, serverConfig.maxConcurrentInputs, serverConfig.maxConcurrentOutputs, builder.parallelTracks(), false, "Server", config.defaultHostPath());
    final int routerCount = builder.parallelTracks();
    final Pipe<NetPayloadSchema>[] encryptedIncomingGroup = Pipe.buildPipes(serverConfig.maxConcurrentInputs, serverConfig.incomingDataConfig);
    Pipe[] acks = NetGraphBuilder.buildSocketReaderStage(gm, serverCoord, routerCount, serverConfig, encryptedIncomingGroup);
    Pipe[] handshakeIncomingGroup = null;
    Pipe[] planIncomingGroup;
    if (config.isTLS()) {
        planIncomingGroup = Pipe.buildPipes(serverConfig.maxConcurrentInputs, serverConfig.incomingDataConfig);
        handshakeIncomingGroup = NetGraphBuilder.populateGraphWithUnWrapStages(gm, serverCoord, serverConfig.serverRequestUnwrapUnits, serverConfig.handshakeDataConfig, encryptedIncomingGroup, planIncomingGroup, acks);
    } else {
        planIncomingGroup = encryptedIncomingGroup;
    }
    // Must call here so the beginning stages of the graph are drawn first when exporting graph.
    app.declareBehavior(this);
    buildLastHalfOfGraphForServer(app, serverConfig, serverCoord, routerCount, acks, handshakeIncomingGroup, planIncomingGroup);
}
Also used : ServerCoordinator(com.ociweb.pronghorn.network.ServerCoordinator) ServerPipesConfig(com.ociweb.pronghorn.network.ServerPipesConfig) Pipe(com.ociweb.pronghorn.pipe.Pipe)

Aggregations

ServerCoordinator (com.ociweb.pronghorn.network.ServerCoordinator)1 ServerPipesConfig (com.ociweb.pronghorn.network.ServerPipesConfig)1 Pipe (com.ociweb.pronghorn.pipe.Pipe)1