use of reactor.ipc.netty.NettyContext in project reactor-netty by reactor.
the class ChannelOperationsHandlerTest method doTestPublisherSenderOnCompleteFlushInProgress.
private void doTestPublisherSenderOnCompleteFlushInProgress(boolean useScheduler) {
NettyContext server = HttpServer.create(0).newHandler((req, res) -> req.receive().asString().doOnNext(System.err::println).then(res.status(200).sendHeaders().then())).block(Duration.ofSeconds(30));
Flux<String> flux = Flux.range(1, 257).map(count -> count + "");
if (useScheduler) {
flux.publishOn(Schedulers.single());
}
Mono<HttpClientResponse> client = HttpClient.create(server.address().getPort()).post("/", req -> req.sendString(flux));
StepVerifier.create(client).expectNextMatches(res -> {
res.dispose();
return res.status().code() == 200;
}).expectComplete().verify(Duration.ofSeconds(30));
server.dispose();
}
use of reactor.ipc.netty.NettyContext in project spring-cloud-gateway by spring-cloud.
the class ReactorHttpServer method startInternal.
@Override
protected void startInternal() {
NettyContext nettyContext = this.reactorServer.newHandler(this.reactorHandler).block();
setPort(nettyContext.address().getPort());
this.nettyContext.set(nettyContext);
}
Aggregations