Search in sources :

Example 1 with CompositeCloseable

use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.

the class GrpcRouter method bind.

Single<GrpcServerContext> bind(final ServerBinder binder, final GrpcExecutionContext executionContext) {
    final CompositeCloseable closeable = AsyncCloseables.newCompositeCloseable();
    final Map<String, StreamingHttpService> allRoutes = new HashMap<>();
    populateRoutes(executionContext, allRoutes, routes, closeable, executionStrategies);
    populateRoutes(executionContext, allRoutes, streamingRoutes, closeable, executionStrategies);
    populateRoutes(executionContext, allRoutes, blockingRoutes, closeable, executionStrategies);
    populateRoutes(executionContext, allRoutes, blockingStreamingRoutes, closeable, executionStrategies);
    // TODO: Optimize to bind a specific programming model service based on routes
    return binder.bindStreaming(new StreamingHttpService() {

        @Override
        public Single<StreamingHttpResponse> handle(final HttpServiceContext ctx, final StreamingHttpRequest request, final StreamingHttpResponseFactory responseFactory) {
            final StreamingHttpService service;
            if (!POST.equals(request.method()) || (service = allRoutes.get(request.path())) == null) {
                return NOT_FOUND_SERVICE.handle(ctx, request, responseFactory);
            } else {
                return service.handle(ctx, request, responseFactory);
            }
        }

        @Override
        public Completable closeAsync() {
            return closeable.closeAsync();
        }

        @Override
        public Completable closeAsyncGracefully() {
            return closeable.closeAsyncGracefully();
        }
    }).map(httpServerContext -> new DefaultGrpcServerContext(httpServerContext, executionContext));
}
Also used : HashMap(java.util.HashMap) HttpServiceContext(io.servicetalk.http.api.HttpServiceContext) StreamingHttpResponseFactory(io.servicetalk.http.api.StreamingHttpResponseFactory) CompositeCloseable(io.servicetalk.concurrent.api.CompositeCloseable) BlockingStreamingHttpService(io.servicetalk.http.api.BlockingStreamingHttpService) StreamingHttpServiceToOffloadedStreamingHttpService(io.servicetalk.http.api.StreamingHttpServiceToOffloadedStreamingHttpService) StreamingHttpService(io.servicetalk.http.api.StreamingHttpService) HttpApiConversions.toStreamingHttpService(io.servicetalk.http.api.HttpApiConversions.toStreamingHttpService) BlockingStreamingHttpRequest(io.servicetalk.http.api.BlockingStreamingHttpRequest) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse)

Example 2 with CompositeCloseable

use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.

the class HttpRequestEncoderTest method protocolPayloadEndOutboundShouldNotTriggerOnFailedFlush.

@Test
void protocolPayloadEndOutboundShouldNotTriggerOnFailedFlush() throws Exception {
    AtomicReference<CloseHandler> closeHandlerRef = new AtomicReference<>();
    try (CompositeCloseable resources = newCompositeCloseable()) {
        Processor serverCloseTrigger = newCompletableProcessor();
        CountDownLatch serverChannelLatch = new CountDownLatch(1);
        AtomicReference<Channel> serverChannelRef = new AtomicReference<>();
        ReadOnlyTcpServerConfig sConfig = new TcpServerConfig().asReadOnly();
        ServerContext serverContext = resources.prepend(TcpServerBinder.bind(localAddress(0), sConfig, false, SEC, null, (channel, observer) -> DefaultNettyConnection.initChannel(channel, SEC.bufferAllocator(), SEC.executor(), SEC.ioExecutor(), forPipelinedRequestResponse(false, channel.config()), defaultFlushStrategy(), null, new TcpServerChannelInitializer(sConfig, observer).andThen(channel2 -> {
            serverChannelRef.compareAndSet(null, channel2);
            serverChannelLatch.countDown();
        }), defaultStrategy(), mock(Protocol.class), observer, false, __ -> false), connection -> {
        }).toFuture().get());
        ReadOnlyHttpClientConfig cConfig = new HttpClientConfig().asReadOnly();
        assert cConfig.h1Config() != null;
        NettyConnection<Object, Object> conn = resources.prepend(TcpConnector.connect(null, serverHostAndPort(serverContext), cConfig.tcpConfig(), false, CEC, (channel, connectionObserver) -> {
            CloseHandler closeHandler = spy(forPipelinedRequestResponse(true, channel.config()));
            closeHandlerRef.compareAndSet(null, closeHandler);
            return DefaultNettyConnection.initChannel(channel, CEC.bufferAllocator(), CEC.executor(), CEC.ioExecutor(), closeHandler, defaultFlushStrategy(), null, new TcpClientChannelInitializer(cConfig.tcpConfig(), connectionObserver).andThen(new HttpClientChannelInitializer(getByteBufAllocator(CEC.bufferAllocator()), cConfig.h1Config(), closeHandler)).andThen(channel2 -> channel2.pipeline().addLast(new ChannelInboundHandlerAdapter() {

                @Override
                public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
                    // Propagate the user event in the pipeline before
                    // triggering the test condition.
                    ctx.fireUserEventTriggered(evt);
                    if (evt instanceof ChannelInputShutdownReadComplete) {
                        serverCloseTrigger.onComplete();
                    }
                }
            })), defaultStrategy(), HTTP_1_1, connectionObserver, true, __ -> false);
        }, NoopTransportObserver.INSTANCE).toFuture().get());
        // The server needs to wait to close the conneciton until after the client has established the connection.
        serverChannelLatch.await();
        Channel serverChannel = serverChannelRef.get();
        assertNotNull(serverChannel);
        assumeFalse(serverChannel instanceof NioSocketChannel, "Windows doesn't emit ChannelInputShutdownReadComplete. Investigation Required.");
        ((SocketChannel) serverChannel).config().setSoLinger(0);
        // Close and send RST concurrently with client write
        serverChannel.close();
        StreamingHttpRequest request = reqRespFactory.post("/closeme");
        fromSource(serverCloseTrigger).toFuture().get();
        Completable write = conn.write(from(request, allocator.fromAscii("Bye"), EmptyHttpHeaders.INSTANCE));
        assertThrows(ExecutionException.class, () -> write.toFuture().get());
        CloseHandler closeHandler = closeHandlerRef.get();
        assertNotNull(closeHandler);
        verify(closeHandler, never()).protocolPayloadEndOutbound(any(), any());
    }
}
Also used : UNSUPPORTED_PROTOCOL_CLOSE_HANDLER(io.servicetalk.transport.netty.internal.CloseHandler.UNSUPPORTED_PROTOCOL_CLOSE_HANDLER) ChannelInputShutdownReadComplete(io.netty.channel.socket.ChannelInputShutdownReadComplete) Protocol(io.servicetalk.transport.api.ConnectionInfo.Protocol) ChannelInboundHandlerAdapter(io.netty.channel.ChannelInboundHandlerAdapter) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Integer.toHexString(java.lang.Integer.toHexString) TcpServerChannelInitializer(io.servicetalk.tcp.netty.internal.TcpServerChannelInitializer) TcpServerConfig(io.servicetalk.tcp.netty.internal.TcpServerConfig) ReadOnlyTcpServerConfig(io.servicetalk.tcp.netty.internal.ReadOnlyTcpServerConfig) SourceAdapters.fromSource(io.servicetalk.concurrent.api.SourceAdapters.fromSource) HttpRequestMetaDataFactory.newRequestMetaData(io.servicetalk.http.api.HttpRequestMetaDataFactory.newRequestMetaData) HttpExecutionStrategies.defaultStrategy(io.servicetalk.http.api.HttpExecutionStrategies.defaultStrategy) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) Assumptions.assumeFalse(org.junit.jupiter.api.Assumptions.assumeFalse) CONNECTION(io.servicetalk.http.api.HttpHeaderNames.CONNECTION) USER_AGENT(io.servicetalk.http.api.HttpHeaderNames.USER_AGENT) SocketChannel(io.netty.channel.socket.SocketChannel) TcpConnector(io.servicetalk.tcp.netty.internal.TcpConnector) CompositeCloseable(io.servicetalk.concurrent.api.CompositeCloseable) TRANSFER_ENCODING(io.servicetalk.http.api.HttpHeaderNames.TRANSFER_ENCODING) AsyncCloseables.newCompositeCloseable(io.servicetalk.concurrent.api.AsyncCloseables.newCompositeCloseable) DefaultNettyConnection(io.servicetalk.transport.netty.internal.DefaultNettyConnection) CONTENT_LENGTH(io.servicetalk.http.api.HttpHeaderNames.CONTENT_LENGTH) DefaultHttpHeadersFactory(io.servicetalk.http.api.DefaultHttpHeadersFactory) HttpRequestMetaData(io.servicetalk.http.api.HttpRequestMetaData) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) TcpClientChannelInitializer(io.servicetalk.tcp.netty.internal.TcpClientChannelInitializer) Buffer(io.servicetalk.buffer.api.Buffer) Processor(io.servicetalk.concurrent.CompletableSource.Processor) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) FlushStrategies.defaultFlushStrategy(io.servicetalk.transport.netty.internal.FlushStrategies.defaultFlushStrategy) CloseHandler(io.servicetalk.transport.netty.internal.CloseHandler) Mockito.mock(org.mockito.Mockito.mock) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) DEFAULT_ALLOCATOR(io.servicetalk.buffer.netty.BufferAllocators.DEFAULT_ALLOCATOR) CloseHandler.forPipelinedRequestResponse(io.servicetalk.transport.netty.internal.CloseHandler.forPipelinedRequestResponse) HttpHeaders(io.servicetalk.http.api.HttpHeaders) Mockito.spy(org.mockito.Mockito.spy) AtomicReference(java.util.concurrent.atomic.AtomicReference) EMPTY_BUFFER(io.servicetalk.buffer.api.EmptyBuffer.EMPTY_BUFFER) EmptyHttpHeaders(io.servicetalk.http.api.EmptyHttpHeaders) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ByteBuf(io.netty.buffer.ByteBuf) RegisterExtension(org.junit.jupiter.api.extension.RegisterExtension) NettyIoExecutors.createIoExecutor(io.servicetalk.transport.netty.NettyIoExecutors.createIoExecutor) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) AddressUtils.serverHostAndPort(io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Publisher.from(io.servicetalk.concurrent.api.Publisher.from) Processors.newCompletableProcessor(io.servicetalk.concurrent.api.Processors.newCompletableProcessor) CHUNKED(io.servicetalk.http.api.HttpHeaderValues.CHUNKED) KEEP_ALIVE(io.servicetalk.http.api.HttpHeaderValues.KEEP_ALIVE) ValueSource(org.junit.jupiter.params.provider.ValueSource) AddressUtils.localAddress(io.servicetalk.transport.netty.internal.AddressUtils.localAddress) ServerContext(io.servicetalk.transport.api.ServerContext) StreamingHttpRequestResponseFactory(io.servicetalk.http.api.StreamingHttpRequestResponseFactory) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) Completable(io.servicetalk.concurrent.api.Completable) ExecutionContextExtension(io.servicetalk.transport.netty.internal.ExecutionContextExtension) IOException(java.io.IOException) GET(io.servicetalk.http.api.HttpRequestMethod.GET) TcpServerBinder(io.servicetalk.tcp.netty.internal.TcpServerBinder) Mockito.verify(org.mockito.Mockito.verify) Channel(io.netty.channel.Channel) ExecutionException(java.util.concurrent.ExecutionException) US_ASCII(java.nio.charset.StandardCharsets.US_ASCII) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Mockito.never(org.mockito.Mockito.never) BufferUtils.getByteBufAllocator(io.servicetalk.buffer.netty.BufferUtils.getByteBufAllocator) String.valueOf(java.lang.String.valueOf) BufferAllocator(io.servicetalk.buffer.api.BufferAllocator) Executors(io.servicetalk.concurrent.api.Executors) NettyConnection(io.servicetalk.transport.netty.internal.NettyConnection) ArrayDeque(java.util.ArrayDeque) NoopTransportObserver(io.servicetalk.transport.netty.internal.NoopTransportObserver) INSTANCE(io.servicetalk.http.api.DefaultHttpHeadersFactory.INSTANCE) HTTP_1_1(io.servicetalk.http.api.HttpProtocolVersion.HTTP_1_1) DefaultStreamingHttpRequestResponseFactory(io.servicetalk.http.api.DefaultStreamingHttpRequestResponseFactory) Completable(io.servicetalk.concurrent.api.Completable) Processor(io.servicetalk.concurrent.CompletableSource.Processor) Processors.newCompletableProcessor(io.servicetalk.concurrent.api.Processors.newCompletableProcessor) ChannelInputShutdownReadComplete(io.netty.channel.socket.ChannelInputShutdownReadComplete) CompositeCloseable(io.servicetalk.concurrent.api.CompositeCloseable) AsyncCloseables.newCompositeCloseable(io.servicetalk.concurrent.api.AsyncCloseables.newCompositeCloseable) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ReadOnlyTcpServerConfig(io.servicetalk.tcp.netty.internal.ReadOnlyTcpServerConfig) TcpClientChannelInitializer(io.servicetalk.tcp.netty.internal.TcpClientChannelInitializer) Protocol(io.servicetalk.transport.api.ConnectionInfo.Protocol) SocketChannel(io.netty.channel.socket.SocketChannel) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) Channel(io.netty.channel.Channel) TcpServerChannelInitializer(io.servicetalk.tcp.netty.internal.TcpServerChannelInitializer) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) TcpServerConfig(io.servicetalk.tcp.netty.internal.TcpServerConfig) ReadOnlyTcpServerConfig(io.servicetalk.tcp.netty.internal.ReadOnlyTcpServerConfig) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) ServerContext(io.servicetalk.transport.api.ServerContext) CloseHandler(io.servicetalk.transport.netty.internal.CloseHandler) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) ChannelInboundHandlerAdapter(io.netty.channel.ChannelInboundHandlerAdapter) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 3 with CompositeCloseable

use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.

the class HttpConnectionEmptyPayloadTest method headRequestContentEmpty.

@Test
void headRequestContentEmpty() throws Exception {
    try (CompositeCloseable closeable = AsyncCloseables.newCompositeCloseable()) {
        final int expectedContentLength = 128;
        byte[] expectedPayload = new byte[expectedContentLength];
        ThreadLocalRandom.current().nextBytes(expectedPayload);
        ServerContext serverContext = closeable.merge(HttpServers.forAddress(localAddress(0)).ioExecutor(executionContextRule.ioExecutor()).executionStrategy(offloadNever()).listenStreamingAndAwait((ctx, req, factory) -> {
            StreamingHttpResponse resp = factory.ok().payloadBody(from(HEAD.equals(req.method()) ? EMPTY_BUFFER : ctx.executionContext().bufferAllocator().newBuffer(expectedContentLength).writeBytes(expectedPayload)));
            resp.addHeader(CONTENT_LENGTH, String.valueOf(expectedContentLength));
            return succeeded(resp);
        }));
        StreamingHttpClient client = closeable.merge(forResolvedAddress(serverHostAndPort(serverContext)).ioExecutor(executionContextRule.ioExecutor()).protocols(h1().maxPipelinedRequests(3).build()).executor(executionContextRule.executor()).executionStrategy(defaultStrategy()).buildStreaming());
        StreamingHttpConnection connection = closeable.merge(client.reserveConnection(client.get("/")).toFuture().get());
        // Request HEAD, GET, HEAD to verify that we can keep reading data despite a HEAD request providing a hint
        // about content-length (and not actually providing the content).
        Single<StreamingHttpResponse> response1Single = connection.request(connection.newRequest(HEAD, "/"));
        Single<StreamingHttpResponse> response2Single = connection.request(connection.get("/"));
        Single<StreamingHttpResponse> response3Single = connection.request(connection.newRequest(HEAD, "/"));
        StreamingHttpResponse response = awaitIndefinitelyNonNull(response1Single);
        assertEquals(OK, response.status());
        CharSequence contentLength = response.headers().get(CONTENT_LENGTH);
        assertNotNull(contentLength);
        assertEquals(expectedContentLength, parseInt(contentLength.toString()));
        // Drain the current response content so we will be able to read the next response.
        response.messageBody().ignoreElements().toFuture().get();
        response = awaitIndefinitelyNonNull(response2Single);
        assertEquals(OK, response.status());
        contentLength = response.headers().get(CONTENT_LENGTH);
        assertNotNull(contentLength);
        assertEquals(expectedContentLength, parseInt(contentLength.toString()));
        Buffer buffer = awaitIndefinitelyNonNull(response.payloadBody().collect(() -> connection.connectionContext().executionContext().bufferAllocator().newBuffer(), Buffer::writeBytes));
        byte[] actualBytes = new byte[buffer.readableBytes()];
        buffer.readBytes(actualBytes);
        assertArrayEquals(expectedPayload, actualBytes);
        response = awaitIndefinitelyNonNull(response3Single);
        assertEquals(OK, response.status());
        contentLength = response.headers().get(CONTENT_LENGTH);
        assertNotNull(contentLength);
        assertEquals(expectedContentLength, parseInt(contentLength.toString()));
        response.messageBody().ignoreElements().toFuture().get();
    }
}
Also used : Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) EMPTY_BUFFER(io.servicetalk.buffer.api.EmptyBuffer.EMPTY_BUFFER) HttpExecutionStrategies.defaultStrategy(io.servicetalk.http.api.HttpExecutionStrategies.defaultStrategy) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) RegisterExtension(org.junit.jupiter.api.extension.RegisterExtension) HEAD(io.servicetalk.http.api.HttpRequestMethod.HEAD) Single.succeeded(io.servicetalk.concurrent.api.Single.succeeded) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) BlockingTestUtils.awaitIndefinitelyNonNull(io.servicetalk.concurrent.api.BlockingTestUtils.awaitIndefinitelyNonNull) AddressUtils.serverHostAndPort(io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Publisher.from(io.servicetalk.concurrent.api.Publisher.from) AddressUtils.localAddress(io.servicetalk.transport.netty.internal.AddressUtils.localAddress) ExecutionContextExtension.immediate(io.servicetalk.transport.netty.internal.ExecutionContextExtension.immediate) ServerContext(io.servicetalk.transport.api.ServerContext) HttpProtocolConfigs.h1(io.servicetalk.http.netty.HttpProtocolConfigs.h1) StreamingHttpConnection(io.servicetalk.http.api.StreamingHttpConnection) Single(io.servicetalk.concurrent.api.Single) CompositeCloseable(io.servicetalk.concurrent.api.CompositeCloseable) ExecutionContextExtension(io.servicetalk.transport.netty.internal.ExecutionContextExtension) CONTENT_LENGTH(io.servicetalk.http.api.HttpHeaderNames.CONTENT_LENGTH) OK(io.servicetalk.http.api.HttpResponseStatus.OK) Integer.parseInt(java.lang.Integer.parseInt) HttpClients.forResolvedAddress(io.servicetalk.http.netty.HttpClients.forResolvedAddress) Test(org.junit.jupiter.api.Test) Assertions.assertArrayEquals(org.junit.jupiter.api.Assertions.assertArrayEquals) Buffer(io.servicetalk.buffer.api.Buffer) AsyncCloseables(io.servicetalk.concurrent.api.AsyncCloseables) HttpExecutionStrategies.offloadNever(io.servicetalk.http.api.HttpExecutionStrategies.offloadNever) Buffer(io.servicetalk.buffer.api.Buffer) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) ServerContext(io.servicetalk.transport.api.ServerContext) CompositeCloseable(io.servicetalk.concurrent.api.CompositeCloseable) StreamingHttpConnection(io.servicetalk.http.api.StreamingHttpConnection) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) Test(org.junit.jupiter.api.Test)

Example 4 with CompositeCloseable

use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.

the class HttpOffloadingTest method afterTest.

@AfterEach
void afterTest() throws Exception {
    CompositeCloseable closeables = newCompositeCloseable();
    Stream.of(httpConnection, client, serverContext).filter(Objects::nonNull).map(AsyncCloseable.class::cast).forEach(closeables::append);
    closeables.close();
}
Also used : CompositeCloseable(io.servicetalk.concurrent.api.CompositeCloseable) AsyncCloseables.newCompositeCloseable(io.servicetalk.concurrent.api.AsyncCloseables.newCompositeCloseable) Objects(java.util.Objects) AfterEach(org.junit.jupiter.api.AfterEach)

Example 5 with CompositeCloseable

use of io.servicetalk.concurrent.api.CompositeCloseable in project servicetalk by apple.

the class BackendsStarter method main.

public static void main(String[] args) throws Exception {
    // Create an AutoCloseable representing all resources used in this example.
    try (CompositeCloseable resources = newCompositeCloseable()) {
        // Shared IoExecutor for the application.
        IoExecutor ioExecutor = resources.prepend(createIoExecutor());
        // This is a single Completable used to await closing of all backends started by this class. It is used to
        // provide a way to not let main() exit.
        Completable allServicesOnClose = completed();
        BackendStarter starter = new BackendStarter(ioExecutor, resources);
        final ServerContext recommendationService = starter.start(RECOMMENDATIONS_BACKEND_ADDRESS.port(), RECOMMENDATION_SERVICE_NAME, newRecommendationsService());
        allServicesOnClose = allServicesOnClose.merge(recommendationService.onClose());
        final ServerContext metadataService = starter.start(METADATA_BACKEND_ADDRESS.port(), METADATA_SERVICE_NAME, newMetadataService());
        allServicesOnClose = allServicesOnClose.merge(metadataService.onClose());
        final ServerContext userService = starter.start(USER_BACKEND_ADDRESS.port(), USER_SERVICE_NAME, newUserService());
        allServicesOnClose = allServicesOnClose.merge(userService.onClose());
        final ServerContext ratingService = starter.start(RATINGS_BACKEND_ADDRESS.port(), RATING_SERVICE_NAME, newRatingService());
        allServicesOnClose = allServicesOnClose.merge(ratingService.onClose());
        // Await termination of all backends started by this class.
        allServicesOnClose.toFuture().get();
    }
}
Also used : Completable(io.servicetalk.concurrent.api.Completable) IoExecutor(io.servicetalk.transport.api.IoExecutor) NettyIoExecutors.createIoExecutor(io.servicetalk.transport.netty.NettyIoExecutors.createIoExecutor) ServerContext(io.servicetalk.transport.api.ServerContext) CompositeCloseable(io.servicetalk.concurrent.api.CompositeCloseable) AsyncCloseables.newCompositeCloseable(io.servicetalk.concurrent.api.AsyncCloseables.newCompositeCloseable)

Aggregations

CompositeCloseable (io.servicetalk.concurrent.api.CompositeCloseable)23 AsyncCloseables.newCompositeCloseable (io.servicetalk.concurrent.api.AsyncCloseables.newCompositeCloseable)16 AfterEach (org.junit.jupiter.api.AfterEach)10 ServerContext (io.servicetalk.transport.api.ServerContext)7 AsyncCloseables (io.servicetalk.concurrent.api.AsyncCloseables)3 Completable (io.servicetalk.concurrent.api.Completable)3 Single.succeeded (io.servicetalk.concurrent.api.Single.succeeded)3 HttpExecutionStrategies.defaultStrategy (io.servicetalk.http.api.HttpExecutionStrategies.defaultStrategy)3 StreamingHttpClient (io.servicetalk.http.api.StreamingHttpClient)3 StreamingHttpRequest (io.servicetalk.http.api.StreamingHttpRequest)3 StreamingHttpResponse (io.servicetalk.http.api.StreamingHttpResponse)3 StreamingHttpService (io.servicetalk.http.api.StreamingHttpService)3 AddressUtils.localAddress (io.servicetalk.transport.netty.internal.AddressUtils.localAddress)3 AddressUtils.serverHostAndPort (io.servicetalk.transport.netty.internal.AddressUtils.serverHostAndPort)3 ExecutionContextExtension (io.servicetalk.transport.netty.internal.ExecutionContextExtension)3 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)3 Test (org.junit.jupiter.api.Test)3 RegisterExtension (org.junit.jupiter.api.extension.RegisterExtension)3 Channel (io.netty.channel.Channel)2 Buffer (io.servicetalk.buffer.api.Buffer)2