Example usage for io.netty.handler.codec.http HttpResponseStatus PROCESSING

List of usage examples for io.netty.handler.codec.http HttpResponseStatus PROCESSING

Introduction

In this page you can find the example usage for io.netty.handler.codec.http HttpResponseStatus PROCESSING.

Prototype

HttpResponseStatus PROCESSING

To view the source code for io.netty.handler.codec.http HttpResponseStatus PROCESSING.

Click Source Link

Document

102 Processing (WebDAV, RFC2518)

Usage

From source file:reactor.ipc.netty.http.client.HttpClientTest.java

License:Open Source License

@Test
public void prematureCancel() throws Exception {
    DirectProcessor<Void> signal = DirectProcessor.create();
    NettyContext x = TcpServer.create("localhost", 0).newHandler((in, out) -> {
        signal.onComplete();/*w w w. j  av  a 2  s.  c  om*/
        return out.context(c -> c.addHandlerFirst(new HttpResponseEncoder()))
                .sendObject(Mono.delay(Duration.ofSeconds(2)).map(
                        t -> new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.PROCESSING)))
                .neverComplete();
    }).block(Duration.ofSeconds(30));

    StepVerifier.create(
            HttpClient.create(x.address().getHostName(), x.address().getPort()).get("/").timeout(signal))
            .verifyError(TimeoutException.class);
    //      Thread.sleep(1000000);
}