Search in sources :

Example 11 with Single

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

the class HttpLifecycleObserverTest method testClientCancelsRequestAfterResponse.

@ParameterizedTest(name = "{displayName} [{index}] protocol={0}")
@EnumSource(HttpProtocol.class)
void testClientCancelsRequestAfterResponse(HttpProtocol protocol) throws Exception {
    TestPublisher<Buffer> serverResponsePayload = new TestPublisher<>();
    serviceFilterFactory(service -> new StreamingHttpServiceFilter(service) {

        @Override
        public Single<StreamingHttpResponse> handle(HttpServiceContext ctx, StreamingHttpRequest request, StreamingHttpResponseFactory responseFactory) {
            return request.payloadBody().ignoreElements().concat(succeeded(responseFactory.ok().payloadBody(serverResponsePayload)));
        }
    });
    setUp(protocol);
    StreamingHttpConnection connection = streamingHttpConnection();
    StreamingHttpRequest request = connection.post("/").payloadBody(Publisher.from(CONTENT.duplicate())).transform(// adds empty trailers
    new StatelessTrailersTransformer<>());
    StreamingHttpResponse response = connection.request(request).toFuture().get();
    assertResponse(response, protocol.version, OK);
    Future<Collection<Buffer>> payload = response.payloadBody().toFuture();
    payload.cancel(true);
    if (protocol == HttpProtocol.HTTP_1) {
        // wait for cancellation to close the connection:
        connection.onClose().toFuture().get();
    }
    // try to write server content to trigger write failure and close the server-side connection:
    serverResponsePayload.onNext(CONTENT.duplicate());
    bothTerminate.await();
    clientInOrder.verify(clientLifecycleObserver).onNewExchange();
    clientInOrder.verify(clientExchangeObserver).onConnectionSelected(any(ConnectionInfo.class));
    clientInOrder.verify(clientExchangeObserver).onRequest(any(StreamingHttpRequest.class));
    clientInOrder.verify(clientExchangeObserver).onResponse(any(StreamingHttpResponse.class));
    clientInOrder.verify(clientResponseObserver, atLeastOnce()).onResponseDataRequested(anyLong());
    clientInOrder.verify(clientResponseObserver).onResponseCancel();
    verify(clientRequestObserver, atLeastOnce()).onRequestDataRequested(anyLong());
    clientRequestInOrder.verify(clientRequestObserver).onRequestData(any(Buffer.class));
    clientRequestInOrder.verify(clientRequestObserver).onRequestTrailers(any(HttpHeaders.class));
    clientRequestInOrder.verify(clientRequestObserver).onRequestComplete();
    clientInOrder.verify(clientExchangeObserver).onExchangeFinally();
    verifyNoMoreInteractions(clientLifecycleObserver, clientExchangeObserver, clientRequestObserver, clientResponseObserver);
    serverInOrder.verify(serverLifecycleObserver).onNewExchange();
    serverInOrder.verify(serverExchangeObserver).onConnectionSelected(any(ConnectionInfo.class));
    serverInOrder.verify(serverExchangeObserver).onRequest(any(StreamingHttpRequest.class));
    serverInOrder.verify(serverExchangeObserver).onResponse(any(StreamingHttpResponse.class));
    verify(serverResponseObserver, atLeastOnce()).onResponseDataRequested(anyLong());
    verify(serverResponseObserver, atMostOnce()).onResponseData(any(Buffer.class));
    serverInOrder.verify(serverResponseObserver).onResponseCancel();
    serverRequestInOrder.verify(serverRequestObserver, atLeastOnce()).onRequestDataRequested(anyLong());
    serverRequestInOrder.verify(serverRequestObserver).onRequestData(any(Buffer.class));
    serverRequestInOrder.verify(serverRequestObserver).onRequestComplete();
    serverInOrder.verify(serverExchangeObserver).onExchangeFinally();
    verifyNoMoreInteractions(serverLifecycleObserver, serverExchangeObserver, serverRequestObserver, serverResponseObserver);
}
Also used : Buffer(io.servicetalk.buffer.api.Buffer) HttpHeaders(io.servicetalk.http.api.HttpHeaders) TestPublisher(io.servicetalk.concurrent.api.TestPublisher) StreamingHttpResponseFactory(io.servicetalk.http.api.StreamingHttpResponseFactory) StreamingHttpServiceFilter(io.servicetalk.http.api.StreamingHttpServiceFilter) Single(io.servicetalk.concurrent.api.Single) HttpServiceContext(io.servicetalk.http.api.HttpServiceContext) Collection(java.util.Collection) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) ConnectionInfo(io.servicetalk.transport.api.ConnectionInfo) StreamingHttpConnection(io.servicetalk.http.api.StreamingHttpConnection) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 12 with Single

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

the class DeferredServerChannelBinder method bind.

static Single<HttpServerContext> bind(final HttpExecutionContext executionContext, final ReadOnlyHttpServerConfig config, final SocketAddress listenAddress, @Nullable final InfluencerConnectionAcceptor connectionAcceptor, final StreamingHttpService service, final boolean drainRequestPayloadBody, final boolean sniOnly) {
    final ReadOnlyTcpServerConfig tcpConfig = config.tcpConfig();
    assert tcpConfig.sslContext() != null;
    final BiFunction<Channel, ConnectionObserver, Single<NettyConnectionContext>> channelInit = sniOnly ? (channel, connectionObserver) -> sniInitChannel(listenAddress, channel, config, executionContext, service, drainRequestPayloadBody, connectionObserver) : (channel, connectionObserver) -> alpnInitChannel(listenAddress, channel, config, executionContext, service, drainRequestPayloadBody, connectionObserver);
    // In case ALPN negotiates h2, h2 connection MUST enable auto read for its Channel.
    return TcpServerBinder.bind(listenAddress, tcpConfig, false, executionContext, connectionAcceptor, channelInit, serverConnection -> {
        // Start processing requests on http/1.1 connection:
        if (serverConnection instanceof NettyHttpServerConnection) {
            ((NettyHttpServerConnection) serverConnection).process(true);
        }
    // Nothing to do otherwise as h2 uses auto read on the parent channel
    }).map(delegate -> {
        LOGGER.debug("Started HTTP server with ALPN for address {}", delegate.listenAddress());
        // The ServerContext returned by TcpServerBinder takes care of closing the connectionAcceptor.
        return new NettyHttpServer.NettyHttpServerContext(delegate, service, executionContext);
    });
}
Also used : ConnectionObserver(io.servicetalk.transport.api.ConnectionObserver) NettyHttpServerConnection(io.servicetalk.http.netty.NettyHttpServer.NettyHttpServerConnection) Logger(org.slf4j.Logger) SocketAddress(java.net.SocketAddress) HTTP_2(io.servicetalk.http.netty.AlpnIds.HTTP_2) Single(io.servicetalk.concurrent.api.Single) BiFunction(java.util.function.BiFunction) LoggerFactory(org.slf4j.LoggerFactory) TcpServerChannelInitializer(io.servicetalk.tcp.netty.internal.TcpServerChannelInitializer) InfluencerConnectionAcceptor(io.servicetalk.transport.netty.internal.InfluencerConnectionAcceptor) TcpServerBinder(io.servicetalk.tcp.netty.internal.TcpServerBinder) ReadOnlyTcpServerConfig(io.servicetalk.tcp.netty.internal.ReadOnlyTcpServerConfig) Channel(io.netty.channel.Channel) ConnectionObserver(io.servicetalk.transport.api.ConnectionObserver) StreamingHttpService(io.servicetalk.http.api.StreamingHttpService) HTTP_1_1(io.servicetalk.http.netty.AlpnIds.HTTP_1_1) HttpServerContext(io.servicetalk.http.api.HttpServerContext) NoopChannelInitializer(io.servicetalk.http.netty.AlpnChannelSingle.NoopChannelInitializer) Single.failed(io.servicetalk.concurrent.api.Single.failed) NettyConnectionContext(io.servicetalk.transport.netty.internal.NettyConnectionContext) Nullable(javax.annotation.Nullable) HttpExecutionContext(io.servicetalk.http.api.HttpExecutionContext) NettyHttpServerConnection(io.servicetalk.http.netty.NettyHttpServer.NettyHttpServerConnection) Single(io.servicetalk.concurrent.api.Single) Channel(io.netty.channel.Channel) ReadOnlyTcpServerConfig(io.servicetalk.tcp.netty.internal.ReadOnlyTcpServerConfig)

Example 13 with Single

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

the class AbstractLifecycleObserverHttpFilter method trackLifecycle.

/**
 * Returns a {@link Single} tracking the request/response, capturing lifecycle events as they are observed.
 *
 * @param connInfo {@link ConnectionInfo} connection information.
 * @param request the {@link StreamingHttpRequest}.
 * @param responseFunction produces {@link Single}&lt;{@link StreamingHttpResponses}&gt;.
 * @return a {@link Single} tracking the request/response, capturing lifecycle events as they are observed.
 */
final Single<StreamingHttpResponse> trackLifecycle(@Nullable final ConnectionInfo connInfo, final StreamingHttpRequest request, final Function<StreamingHttpRequest, Single<StreamingHttpResponse>> responseFunction) {
    return defer(() -> {
        final HttpExchangeObserver onExchange = safeReport(observer::onNewExchange, observer, "onNewExchange", NoopHttpExchangeObserver.INSTANCE);
        final boolean clearAsyncContext;
        if (connInfo != null) {
            safeReport(onExchange::onConnectionSelected, connInfo, onExchange, "onConnectionSelected");
            clearAsyncContext = false;
        } else {
            // Pass it down to LoadBalancedStreamingHttpClient
            // FIXME: switch to RequestContext when it's available
            AsyncContext.put(ON_CONNECTION_SELECTED_CONSUMER, selectedConnection -> safeReport(onExchange::onConnectionSelected, selectedConnection, onExchange, "onConnectionSelected"));
            clearAsyncContext = true;
        }
        final ExchangeContext exchangeContext = new ExchangeContext(onExchange, client, clearAsyncContext);
        final HttpRequestObserver onRequest = safeReport(onExchange::onRequest, request, onExchange, "onRequest", NoopHttpRequestObserver.INSTANCE);
        final StreamingHttpRequest transformed = request.transformMessageBody(p -> {
            if (client) {
                p = p.beforeSubscriber(() -> {
                    exchangeContext.requestMessageBodyStarts();
                    return NoopSubscriber.INSTANCE;
                });
            }
            return p.beforeRequest(n -> safeReport(onRequest::onRequestDataRequested, n, onRequest, "onRequestDataRequested")).beforeOnNext(item -> {
                if (item instanceof Buffer) {
                    safeReport(onRequest::onRequestData, (Buffer) item, onRequest, "onRequestData");
                } else if (item instanceof HttpHeaders) {
                    safeReport(onRequest::onRequestTrailers, (HttpHeaders) item, onRequest, "onRequestTrailers");
                } else {
                    LOGGER.warn("Programming mistake: unexpected message body item is received on the request: {}", item.getClass().getName());
                }
            }).beforeFinally(new TerminalSignalConsumer() {

                @Override
                public void onComplete() {
                    safeReport(onRequest::onRequestComplete, onRequest, "onRequestComplete");
                    exchangeContext.decrementRemaining();
                }

                @Override
                public void onError(final Throwable cause) {
                    safeReport(onRequest::onRequestError, cause, onRequest, "onRequestError");
                    exchangeContext.decrementRemaining();
                }

                @Override
                public void cancel() {
                    safeReport(onRequest::onRequestCancel, onRequest, "onRequestCancel");
                    exchangeContext.decrementRemaining();
                }
            });
        });
        final Single<StreamingHttpResponse> responseSingle;
        try {
            responseSingle = responseFunction.apply(transformed);
        } catch (Throwable t) {
            onExchange.onResponseError(t);
            return Single.<StreamingHttpResponse>failed(t).shareContextOnSubscribe();
        }
        return responseSingle.liftSync(new BeforeFinallyHttpOperator(exchangeContext, /* discardEventsAfterCancel */
        true)).map(resp -> {
            exchangeContext.onResponse(resp);
            return resp.transformMessageBody(p -> p.beforeRequest(exchangeContext::onResponseDataRequested).beforeOnNext(exchangeContext::onResponseBody));
        }).shareContextOnSubscribe();
    });
}
Also used : AtomicIntegerFieldUpdater(java.util.concurrent.atomic.AtomicIntegerFieldUpdater) HttpLifecycleObserver(io.servicetalk.http.api.HttpLifecycleObserver) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) StreamingHttpResponses(io.servicetalk.http.api.StreamingHttpResponses) LoggerFactory(org.slf4j.LoggerFactory) TerminalSignalConsumer(io.servicetalk.concurrent.api.TerminalSignalConsumer) HttpHeaders(io.servicetalk.http.api.HttpHeaders) HttpResponseMetaData(io.servicetalk.http.api.HttpResponseMetaData) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Key.newKey(io.servicetalk.context.api.ContextMap.Key.newKey) HttpResponseObserver(io.servicetalk.http.api.HttpLifecycleObserver.HttpResponseObserver) ConnectionInfo(io.servicetalk.transport.api.ConnectionInfo) ThrowableUtils.addSuppressed(io.servicetalk.utils.internal.ThrowableUtils.addSuppressed) AsyncContext(io.servicetalk.concurrent.api.AsyncContext) HttpExecutionStrategies(io.servicetalk.http.api.HttpExecutionStrategies) Objects.requireNonNull(java.util.Objects.requireNonNull) HttpExecutionStrategy(io.servicetalk.http.api.HttpExecutionStrategy) HttpRequestObserver(io.servicetalk.http.api.HttpLifecycleObserver.HttpRequestObserver) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) Nullable(javax.annotation.Nullable) Logger(org.slf4j.Logger) NoopHttpExchangeObserver(io.servicetalk.http.netty.NoopHttpLifecycleObserver.NoopHttpExchangeObserver) Single.defer(io.servicetalk.concurrent.api.Single.defer) PublisherSource(io.servicetalk.concurrent.PublisherSource) Single(io.servicetalk.concurrent.api.Single) HttpExecutionStrategyInfluencer(io.servicetalk.http.api.HttpExecutionStrategyInfluencer) HttpExchangeObserver(io.servicetalk.http.api.HttpLifecycleObserver.HttpExchangeObserver) Consumer(java.util.function.Consumer) Buffer(io.servicetalk.buffer.api.Buffer) ContextMap(io.servicetalk.context.api.ContextMap) NoopHttpRequestObserver(io.servicetalk.http.netty.NoopHttpLifecycleObserver.NoopHttpRequestObserver) BeforeFinallyHttpOperator(io.servicetalk.http.utils.BeforeFinallyHttpOperator) Buffer(io.servicetalk.buffer.api.Buffer) TerminalSignalConsumer(io.servicetalk.concurrent.api.TerminalSignalConsumer) HttpHeaders(io.servicetalk.http.api.HttpHeaders) HttpRequestObserver(io.servicetalk.http.api.HttpLifecycleObserver.HttpRequestObserver) NoopHttpRequestObserver(io.servicetalk.http.netty.NoopHttpLifecycleObserver.NoopHttpRequestObserver) BeforeFinallyHttpOperator(io.servicetalk.http.utils.BeforeFinallyHttpOperator) NoopHttpExchangeObserver(io.servicetalk.http.netty.NoopHttpLifecycleObserver.NoopHttpExchangeObserver) HttpExchangeObserver(io.servicetalk.http.api.HttpLifecycleObserver.HttpExchangeObserver) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse)

Example 14 with Single

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

the class AbstractStreamingHttpConnection method request.

@Override
public Single<StreamingHttpResponse> request(final StreamingHttpRequest request) {
    return defer(() -> {
        Publisher<Object> flatRequest;
        // See https://tools.ietf.org/html/rfc7230#section-3.3.3
        if (canAddRequestContentLength(request)) {
            flatRequest = setRequestContentLength(connectionContext().protocol(), request);
        } else {
            if (emptyMessageBody(request, request.messageBody())) {
                flatRequest = flatEmptyMessage(connectionContext().protocol(), request, request.messageBody());
            } else {
                // Defer subscribe to the messageBody until transport requests it to allow clients retry failed
                // requests with non-replayable messageBody
                flatRequest = Single.<Object>succeeded(request).concat(request.messageBody(), true);
                if (shouldAppendTrailers(connectionContext().protocol(), request)) {
                    flatRequest = flatRequest.scanWith(HeaderUtils::appendTrailersMapper);
                }
            }
            addRequestTransferEncodingIfNecessary(request);
        }
        final HttpExecutionStrategy strategy = requestExecutionStrategy(request, executionContext().executionStrategy());
        if (strategy.isSendOffloaded()) {
            flatRequest = flatRequest.subscribeOn(connectionContext.executionContext().executor(), IoThreadFactory.IoThread::currentThreadIsIoThread);
        }
        Single<StreamingHttpResponse> resp = invokeClient(flatRequest, determineFlushStrategyForApi(request));
        if (strategy.isMetadataReceiveOffloaded()) {
            resp = resp.publishOn(connectionContext.executionContext().executor(), IoThreadFactory.IoThread::currentThreadIsIoThread);
        }
        if (strategy.isDataReceiveOffloaded()) {
            resp = resp.map(response -> response.transformMessageBody(payload -> payload.publishOn(connectionContext.executionContext().executor(), IoThreadFactory.IoThread::currentThreadIsIoThread)));
        }
        return resp.shareContextOnSubscribe();
    });
}
Also used : FlushStrategy(io.servicetalk.transport.netty.internal.FlushStrategy) HeaderUtils.canAddRequestContentLength(io.servicetalk.http.netty.HeaderUtils.canAddRequestContentLength) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) HttpRequestMethod(io.servicetalk.http.api.HttpRequestMethod) Publisher(io.servicetalk.concurrent.api.Publisher) StreamingHttpResponses.newTransportResponse(io.servicetalk.http.api.StreamingHttpResponses.newTransportResponse) ConsumableEvent(io.servicetalk.client.api.ConsumableEvent) HttpResponseMetaData(io.servicetalk.http.api.HttpResponseMetaData) HttpApiConversions.isSafeToAggregate(io.servicetalk.http.api.HttpApiConversions.isSafeToAggregate) FilterableStreamingHttpConnection(io.servicetalk.http.api.FilterableStreamingHttpConnection) FlushStrategies.flushOnEnd(io.servicetalk.transport.netty.internal.FlushStrategies.flushOnEnd) HttpMetaData(io.servicetalk.http.api.HttpMetaData) IoThreadFactory(io.servicetalk.transport.api.IoThreadFactory) Single.succeeded(io.servicetalk.concurrent.api.Single.succeeded) HttpApiConversions.isPayloadEmpty(io.servicetalk.http.api.HttpApiConversions.isPayloadEmpty) Objects.requireNonNull(java.util.Objects.requireNonNull) HttpExecutionStrategy(io.servicetalk.http.api.HttpExecutionStrategy) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) NettyConnectionContext(io.servicetalk.transport.netty.internal.NettyConnectionContext) HeaderUtils.addRequestTransferEncodingIfNecessary(io.servicetalk.http.netty.HeaderUtils.addRequestTransferEncodingIfNecessary) Publisher.from(io.servicetalk.concurrent.api.Publisher.from) ClientInvoker(io.servicetalk.http.api.ClientInvoker) HttpConnectionContext(io.servicetalk.http.api.HttpConnectionContext) Nullable(javax.annotation.Nullable) HttpExecutionContext(io.servicetalk.http.api.HttpExecutionContext) HeaderUtils.flatEmptyMessage(io.servicetalk.http.netty.HeaderUtils.flatEmptyMessage) Executors.immediate(io.servicetalk.concurrent.api.Executors.immediate) StreamingHttpRequestResponseFactory(io.servicetalk.http.api.StreamingHttpRequestResponseFactory) Single.defer(io.servicetalk.concurrent.api.Single.defer) HeaderUtils.setRequestContentLength(io.servicetalk.http.netty.HeaderUtils.setRequestContentLength) Single(io.servicetalk.concurrent.api.Single) HeaderUtils.emptyMessageBody(io.servicetalk.http.netty.HeaderUtils.emptyMessageBody) HeaderUtils.shouldAppendTrailers(io.servicetalk.http.netty.HeaderUtils.shouldAppendTrailers) Completable(io.servicetalk.concurrent.api.Completable) HTTP_EXECUTION_STRATEGY_KEY(io.servicetalk.http.api.HttpContextKeys.HTTP_EXECUTION_STRATEGY_KEY) HttpEventKey(io.servicetalk.http.api.HttpEventKey) HttpRequestMetaData(io.servicetalk.http.api.HttpRequestMetaData) IgnoreConsumedEvent(io.servicetalk.client.api.internal.IgnoreConsumedEvent) Publisher.failed(io.servicetalk.concurrent.api.Publisher.failed) StreamingHttpResponseFactory(io.servicetalk.http.api.StreamingHttpResponseFactory) REQ_EXPECT_CONTINUE(io.servicetalk.http.netty.HeaderUtils.REQ_EXPECT_CONTINUE) HttpHeadersFactory(io.servicetalk.http.api.HttpHeadersFactory) IoThreadFactory(io.servicetalk.transport.api.IoThreadFactory) HttpExecutionStrategy(io.servicetalk.http.api.HttpExecutionStrategy) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse)

Example 15 with Single

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

the class CompressionFilterExampleClient method main.

public static void main(String... args) throws Exception {
    try (HttpClient client = HttpClients.forSingleAddress("localhost", 8080).appendClientFilter(new ContentEncodingHttpRequesterFilter(new BufferDecoderGroupBuilder().add(deflateDefault(), true).add(identityEncoder(), false).build())).build()) {
        // Make a request with an uncompressed payload.
        HttpRequest request = client.post("/sayHello1").contentEncoding(identityEncoder()).payloadBody("World1", textSerializerUtf8());
        Single<HttpResponse> respSingle1 = client.request(request).whenOnSuccess(resp -> {
            System.out.println(resp.toString((name, value) -> value));
            System.out.println(resp.payloadBody(textSerializerUtf8()));
        });
        // Make a request with an gzip compressed payload.
        request = client.post("/sayHello2").contentEncoding(gzipDefault()).payloadBody("World2", textSerializerUtf8());
        Single<HttpResponse> respSingle2 = client.request(request).whenOnSuccess(resp -> {
            System.out.println(resp.toString((name, value) -> value));
            System.out.println(resp.payloadBody(textSerializerUtf8()));
        });
        // Issue the requests sequentially with concat.
        respSingle1.concat(respSingle2).toFuture().get();
    }
}
Also used : HttpRequest(io.servicetalk.http.api.HttpRequest) BufferDecoderGroupBuilder(io.servicetalk.encoding.api.BufferDecoderGroupBuilder) HttpRequest(io.servicetalk.http.api.HttpRequest) Single(io.servicetalk.concurrent.api.Single) HttpSerializers.textSerializerUtf8(io.servicetalk.http.api.HttpSerializers.textSerializerUtf8) HttpResponse(io.servicetalk.http.api.HttpResponse) NettyBufferEncoders.deflateDefault(io.servicetalk.encoding.netty.NettyBufferEncoders.deflateDefault) ContentEncodingHttpRequesterFilter(io.servicetalk.http.api.ContentEncodingHttpRequesterFilter) HttpClient(io.servicetalk.http.api.HttpClient) Identity.identityEncoder(io.servicetalk.encoding.api.Identity.identityEncoder) NettyBufferEncoders.gzipDefault(io.servicetalk.encoding.netty.NettyBufferEncoders.gzipDefault) HttpClients(io.servicetalk.http.netty.HttpClients) ContentEncodingHttpRequesterFilter(io.servicetalk.http.api.ContentEncodingHttpRequesterFilter) HttpClient(io.servicetalk.http.api.HttpClient) HttpResponse(io.servicetalk.http.api.HttpResponse) BufferDecoderGroupBuilder(io.servicetalk.encoding.api.BufferDecoderGroupBuilder)

Aggregations

Single (io.servicetalk.concurrent.api.Single)57 StreamingHttpRequest (io.servicetalk.http.api.StreamingHttpRequest)34 StreamingHttpResponse (io.servicetalk.http.api.StreamingHttpResponse)34 Nullable (javax.annotation.Nullable)29 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)25 HttpServiceContext (io.servicetalk.http.api.HttpServiceContext)23 StreamingHttpResponseFactory (io.servicetalk.http.api.StreamingHttpResponseFactory)23 Buffer (io.servicetalk.buffer.api.Buffer)22 Single.succeeded (io.servicetalk.concurrent.api.Single.succeeded)21 Test (org.junit.jupiter.api.Test)21 Publisher (io.servicetalk.concurrent.api.Publisher)20 OK (io.servicetalk.http.api.HttpResponseStatus.OK)20 ServerContext (io.servicetalk.transport.api.ServerContext)19 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)19 StreamingHttpServiceFilter (io.servicetalk.http.api.StreamingHttpServiceFilter)18 Matchers.is (org.hamcrest.Matchers.is)18 Completable (io.servicetalk.concurrent.api.Completable)17 InetSocketAddress (java.net.InetSocketAddress)17 AddressUtils.localAddress (io.servicetalk.transport.netty.internal.AddressUtils.localAddress)16 ContextMap (io.servicetalk.context.api.ContextMap)13