Search in sources :

Example 1 with Processor

use of io.servicetalk.concurrent.PublisherSource.Processor in project servicetalk by apple.

the class PublisherFlatMapMergeTest method mappedRecoverMakesProgress.

@Test
void mappedRecoverMakesProgress() throws Exception {
    @SuppressWarnings("unchecked") Subscriber<Integer> mockSubscriber = mock(Subscriber.class);
    CountDownLatch latchOnSubscribe = new CountDownLatch(1);
    CountDownLatch latchOnError = new CountDownLatch(1);
    AtomicReference<Throwable> causeRef = new AtomicReference<>();
    BlockingQueue<Integer> results = new ArrayBlockingQueue<>(10);
    doAnswer(a -> {
        Subscription s = a.getArgument(0);
        s.request(4);
        latchOnSubscribe.countDown();
        return null;
    }).when(mockSubscriber).onSubscribe(any(Subscription.class));
    doAnswer(a -> {
        causeRef.set(a.getArgument(0));
        latchOnError.countDown();
        return null;
    }).when(mockSubscriber).onError(any());
    doAnswer(a -> {
        results.add(a.getArgument(0));
        throw DELIBERATE_EXCEPTION;
    }).when(mockSubscriber).onNext(any());
    Processor<Integer, Integer> processor = newPublisherProcessor();
    toSource(fromSource(processor).flatMapMergeDelayError(i -> from(i + 10).onErrorResume(cause -> from(i + 20).concat(failed(cause))))).subscribe(mockSubscriber);
    latchOnSubscribe.await();
    processor.onNext(1);
    assertThat(results.take(), is(11));
    assertThat(results.take(), is(21));
    assertThat(causeRef.get(), is(nullValue()));
    processor.onComplete();
    latchOnError.await();
    final Throwable t = causeRef.get();
    assertThat(t, is(DELIBERATE_EXCEPTION));
}
Also used : PlatformDependent.throwException(io.servicetalk.utils.internal.PlatformDependent.throwException) AfterAll(org.junit.jupiter.api.AfterAll) SourceAdapters.fromSource(io.servicetalk.concurrent.api.SourceAdapters.fromSource) Future(java.util.concurrent.Future) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) BeforeAll(org.junit.jupiter.api.BeforeAll) EMPTY_SUBSCRIPTION(io.servicetalk.concurrent.internal.EmptySubscriptions.EMPTY_SUBSCRIPTION) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Mockito.doAnswer(org.mockito.Mockito.doAnswer) TestPublisherSubscriber(io.servicetalk.concurrent.test.internal.TestPublisherSubscriber) PublisherSource(io.servicetalk.concurrent.PublisherSource) BlockingQueue(java.util.concurrent.BlockingQueue) Math.min(java.lang.Math.min) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Test(org.junit.jupiter.api.Test) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Matchers.contains(org.hamcrest.Matchers.contains) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Matchers.is(org.hamcrest.Matchers.is) Queue(java.util.Queue) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) Mockito.mock(org.mockito.Mockito.mock) IntStream(java.util.stream.IntStream) Publisher.never(io.servicetalk.concurrent.api.Publisher.never) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Processor(io.servicetalk.concurrent.PublisherSource.Processor) DeliberateException(io.servicetalk.concurrent.internal.DeliberateException) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Publisher.range(io.servicetalk.concurrent.api.Publisher.range) Subscriber(io.servicetalk.concurrent.PublisherSource.Subscriber) ArrayList(java.util.ArrayList) Single.succeeded(io.servicetalk.concurrent.api.Single.succeeded) Matchers.hasSize(org.hamcrest.Matchers.hasSize) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Publisher.from(io.servicetalk.concurrent.api.Publisher.from) DELIBERATE_EXCEPTION(io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION) ExecutorService(java.util.concurrent.ExecutorService) Nullable(javax.annotation.Nullable) ValueSource(org.junit.jupiter.params.provider.ValueSource) Matchers.empty(org.hamcrest.Matchers.empty) Subscription(io.servicetalk.concurrent.PublisherSource.Subscription) Processors.newPublisherProcessor(io.servicetalk.concurrent.api.Processors.newPublisherProcessor) SourceAdapters.toSource(io.servicetalk.concurrent.api.SourceAdapters.toSource) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Publisher.failed(io.servicetalk.concurrent.api.Publisher.failed) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) ArrayDeque(java.util.ArrayDeque) SECONDS(java.util.concurrent.TimeUnit.SECONDS) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) Subscription(io.servicetalk.concurrent.PublisherSource.Subscription) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with Processor

use of io.servicetalk.concurrent.PublisherSource.Processor in project servicetalk by apple.

the class PublisherConcatMapIterableTest method upstreamRecoverWithMakesProgress.

@Test
void upstreamRecoverWithMakesProgress() throws Exception {
    @SuppressWarnings("unchecked") Subscriber<String> mockSubscriber = mock(Subscriber.class);
    CountDownLatch latchOnSubscribe = new CountDownLatch(1);
    CountDownLatch latchOnError = new CountDownLatch(1);
    AtomicReference<Throwable> causeRef = new AtomicReference<>();
    AtomicInteger nextCount = new AtomicInteger();
    List<String> results = new ArrayList<>();
    doAnswer(a -> {
        Subscription s = a.getArgument(0);
        s.request(Long.MAX_VALUE);
        latchOnSubscribe.countDown();
        return null;
    }).when(mockSubscriber).onSubscribe(any(Subscription.class));
    doAnswer(a -> {
        causeRef.set(a.getArgument(0));
        latchOnError.countDown();
        return null;
    }).when(mockSubscriber).onError(eq(DELIBERATE_EXCEPTION));
    doAnswer(a -> {
        results.add(a.getArgument(0));
        if (nextCount.getAndIncrement() == 0) {
            throw new DeliberateException();
        }
        // final exception
        throw DELIBERATE_EXCEPTION;
    }).when(mockSubscriber).onNext(any());
    Processor<List<String>, List<String>> processor = newPublisherProcessor();
    toSource(fromSource(processor).onErrorResume(cause -> {
        if (cause != DELIBERATE_EXCEPTION) {
            // recover!
            return from(singletonList("two"));
        }
        return failed(cause);
    }).flatMapConcatIterable(identity())).subscribe(mockSubscriber);
    latchOnSubscribe.await();
    processor.onNext(asList("one", "ignored!"));
    latchOnError.await();
    assertThat(results, contains("one", "two"));
    assertThat(causeRef.get(), is(DELIBERATE_EXCEPTION));
}
Also used : Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) PlatformDependent.throwException(io.servicetalk.utils.internal.PlatformDependent.throwException) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Processor(io.servicetalk.concurrent.PublisherSource.Processor) DeliberateException(io.servicetalk.concurrent.internal.DeliberateException) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Subscriber(io.servicetalk.concurrent.PublisherSource.Subscriber) ArrayList(java.util.ArrayList) Collections.singletonList(java.util.Collections.singletonList) SourceAdapters.fromSource(io.servicetalk.concurrent.api.SourceAdapters.fromSource) Future(java.util.concurrent.Future) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) RegisterExtension(org.junit.jupiter.api.extension.RegisterExtension) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Arrays.asList(java.util.Arrays.asList) Matchers.nullValue(org.hamcrest.Matchers.nullValue) Mockito.doAnswer(org.mockito.Mockito.doAnswer) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Publisher.from(io.servicetalk.concurrent.api.Publisher.from) DELIBERATE_EXCEPTION(io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION) TestPublisherSubscriber(io.servicetalk.concurrent.test.internal.TestPublisherSubscriber) CyclicBarrier(java.util.concurrent.CyclicBarrier) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Subscription(io.servicetalk.concurrent.PublisherSource.Subscription) Processors.newPublisherProcessor(io.servicetalk.concurrent.api.Processors.newPublisherProcessor) SourceAdapters.toSource(io.servicetalk.concurrent.api.SourceAdapters.toSource) BlockingIterable(io.servicetalk.concurrent.BlockingIterable) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Publisher.failed(io.servicetalk.concurrent.api.Publisher.failed) Matchers.contains(org.hamcrest.Matchers.contains) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Function.identity(java.util.function.Function.identity) Matchers.is(org.hamcrest.Matchers.is) Mockito.mock(org.mockito.Mockito.mock) ArrayList(java.util.ArrayList) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ArrayList(java.util.ArrayList) Collections.singletonList(java.util.Collections.singletonList) Arrays.asList(java.util.Arrays.asList) List(java.util.List) Subscription(io.servicetalk.concurrent.PublisherSource.Subscription) DeliberateException(io.servicetalk.concurrent.internal.DeliberateException) Test(org.junit.jupiter.api.Test)

Example 3 with Processor

use of io.servicetalk.concurrent.PublisherSource.Processor in project servicetalk by apple.

the class H2PriorKnowledgeFeatureParityTest method clientRespectsSettingsFrame.

@ParameterizedTest(name = "{displayName} [{index}] client={0}, h2PriorKnowledge={1}")
@MethodSource("clientExecutors")
void clientRespectsSettingsFrame(HttpTestExecutionStrategy strategy, boolean h2PriorKnowledge) throws Exception {
    setUp(strategy, h2PriorKnowledge);
    assumeTrue(h2PriorKnowledge, "Only HTTP/2 supports SETTINGS frames");
    int expectedMaxConcurrent = 1;
    BlockingQueue<FilterableStreamingHttpConnection> connectionQueue = new LinkedBlockingQueue<>();
    BlockingQueue<Publisher<? extends ConsumableEvent<Integer>>> maxConcurrentPubQueue = new LinkedBlockingQueue<>();
    AtomicReference<Channel> serverParentChannelRef = new AtomicReference<>();
    CountDownLatch serverChannelLatch = new CountDownLatch(1);
    CountDownLatch serverSettingsAckLatch = new CountDownLatch(2);
    serverAcceptorChannel = bindH2Server(serverEventLoopGroup, new ChannelInitializer<Channel>() {

        @Override
        protected void initChannel(final Channel ch) {
            ch.pipeline().addLast(new EchoHttp2Handler());
        }
    }, parentPipeline -> parentPipeline.addLast(new ChannelInboundHandlerAdapter() {

        @Override
        public void channelActive(ChannelHandlerContext ctx) throws Exception {
            if (serverParentChannelRef.compareAndSet(null, ctx.channel())) {
                serverChannelLatch.countDown();
            }
            super.channelActive(ctx);
        }

        @Override
        public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
            if (msg instanceof Http2SettingsAckFrame) {
                serverSettingsAckLatch.countDown();
            }
            super.channelRead(ctx, msg);
        }
    }), identity());
    InetSocketAddress serverAddress = (InetSocketAddress) serverAcceptorChannel.localAddress();
    try (StreamingHttpClient client = forSingleAddress(HostAndPort.of(serverAddress)).protocols(h2PriorKnowledge ? h2Default() : h1Default()).executionStrategy(clientExecutionStrategy).appendConnectionFilter(conn -> new TestConnectionFilter(conn, connectionQueue, maxConcurrentPubQueue)).buildStreaming()) {
        Processor<Buffer, Buffer> requestPayload = newProcessor();
        client.request(client.post("/0").payloadBody(fromSource(requestPayload))).toFuture().get();
        serverChannelLatch.await();
        Channel serverParentChannel = serverParentChannelRef.get();
        serverParentChannel.writeAndFlush(new DefaultHttp2SettingsFrame(new Http2Settings().maxConcurrentStreams(expectedMaxConcurrent))).sync();
        Iterator<? extends ConsumableEvent<Integer>> maxItr = maxConcurrentPubQueue.take().toIterable().iterator();
        // Verify that the initial maxConcurrency value is the default number
        assertThat("No initial maxConcurrency value", maxItr.hasNext(), is(true));
        ConsumableEvent<Integer> next = maxItr.next();
        assertThat(next, is(notNullValue()));
        assertThat("First event is not the default", next.event(), is(SMALLEST_MAX_CONCURRENT_STREAMS));
        // We previously made a request, and intentionally didn't complete the request body. We want to verify
        // that we have received the SETTINGS frame reducing the total number of streams to 1.
        assertThat("No maxConcurrency value received", maxItr.hasNext(), is(true));
        next = maxItr.next();
        assertThat(next, is(notNullValue()));
        assertThat("maxConcurrency did not change to the expected value", next.event(), is(expectedMaxConcurrent));
        // Wait for a server to receive a settings ack
        serverSettingsAckLatch.await();
        // After this point we want to issue a new request and verify that client selects a new connection.
        Processor<Buffer, Buffer> requestPayload2 = newProcessor();
        client.request(client.post("/1").payloadBody(fromSource(requestPayload2))).toFuture().get();
        // We expect 2 connections to be created.
        assertNotSame(connectionQueue.take(), connectionQueue.take());
        requestPayload.onComplete();
        requestPayload2.onComplete();
    }
}
Also used : TestUtils.assertNoAsyncErrors(io.servicetalk.test.resources.TestUtils.assertNoAsyncErrors) UnaryOperator.identity(java.util.function.UnaryOperator.identity) ChannelInboundHandlerAdapter(io.netty.channel.ChannelInboundHandlerAdapter) SingleSource(io.servicetalk.concurrent.SingleSource) StreamingHttpServiceFilterFactory(io.servicetalk.http.api.StreamingHttpServiceFilterFactory) UnaryOperator(java.util.function.UnaryOperator) DefaultHttp2DataFrame(io.netty.handler.codec.http2.DefaultHttp2DataFrame) Disabled(org.junit.jupiter.api.Disabled) Matchers.hasItems(org.hamcrest.Matchers.hasItems) SourceAdapters.fromSource(io.servicetalk.concurrent.api.SourceAdapters.fromSource) H2StreamResetException(io.servicetalk.http.netty.NettyHttp2ExceptionUtils.H2StreamResetException) AsyncContext(io.servicetalk.concurrent.api.AsyncContext) HttpRequest(io.servicetalk.http.api.HttpRequest) Assumptions.assumeFalse(org.junit.jupiter.api.Assumptions.assumeFalse) Matchers.nullValue(org.hamcrest.Matchers.nullValue) HttpCookiePair(io.servicetalk.http.api.HttpCookiePair) EXPECT(io.servicetalk.http.api.HttpHeaderNames.EXPECT) BlockingHttpClient(io.servicetalk.http.api.BlockingHttpClient) PrintWriter(java.io.PrintWriter) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) DefaultHttp2SettingsFrame(io.netty.handler.codec.http2.DefaultHttp2SettingsFrame) HttpClients.forSingleAddress(io.servicetalk.http.netty.HttpClients.forSingleAddress) HttpResponse(io.servicetalk.http.api.HttpResponse) Http2SettingsAckFrame(io.netty.handler.codec.http2.Http2SettingsAckFrame) TRANSFER_ENCODING(io.servicetalk.http.api.HttpHeaderNames.TRANSFER_ENCODING) POST(io.servicetalk.http.api.HttpRequestMethod.POST) BlockingQueue(java.util.concurrent.BlockingQueue) ChannelPipeline(io.netty.channel.ChannelPipeline) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) StatelessTrailersTransformer(io.servicetalk.http.api.StatelessTrailersTransformer) StreamingHttpClientFilter(io.servicetalk.http.api.StreamingHttpClientFilter) StreamingHttpConnectionFilter(io.servicetalk.http.api.StreamingHttpConnectionFilter) Arguments(org.junit.jupiter.params.provider.Arguments) Assertions.assertNotSame(org.junit.jupiter.api.Assertions.assertNotSame) Http2HeadersFrame(io.netty.handler.codec.http2.Http2HeadersFrame) CountDownLatch(java.util.concurrent.CountDownLatch) HttpSetCookie(io.servicetalk.http.api.HttpSetCookie) Buffer(io.servicetalk.buffer.api.Buffer) Stream(java.util.stream.Stream) Http2Headers(io.netty.handler.codec.http2.Http2Headers) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) COOKIE(io.servicetalk.http.api.HttpHeaderNames.COOKIE) Matchers.is(org.hamcrest.Matchers.is) CONTENT_TYPE(io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Processor(io.servicetalk.concurrent.PublisherSource.Processor) BuilderUtils.serverChannel(io.servicetalk.transport.netty.internal.BuilderUtils.serverChannel) TRAILER(io.netty.handler.codec.http.HttpHeaderNames.TRAILER) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) HttpHeaders(io.servicetalk.http.api.HttpHeaders) ConsumableEvent(io.servicetalk.client.api.ConsumableEvent) StreamingHttpRequester(io.servicetalk.http.api.StreamingHttpRequester) FilterableStreamingHttpConnection(io.servicetalk.http.api.FilterableStreamingHttpConnection) ArrayList(java.util.ArrayList) EMPTY_BUFFER(io.servicetalk.buffer.api.EmptyBuffer.EMPTY_BUFFER) MAX_CONCURRENCY(io.servicetalk.http.api.HttpEventKey.MAX_CONCURRENCY) HeaderUtils.isTransferEncodingChunked(io.servicetalk.http.api.HeaderUtils.isTransferEncodingChunked) HttpServiceContext(io.servicetalk.http.api.HttpServiceContext) Single.succeeded(io.servicetalk.concurrent.api.Single.succeeded) Processors(io.servicetalk.concurrent.api.Processors) BiConsumer(java.util.function.BiConsumer) Assumptions.assumeTrue(org.junit.jupiter.api.Assumptions.assumeTrue) StreamingHttpRequest(io.servicetalk.http.api.StreamingHttpRequest) Matchers.contentEqualTo(io.servicetalk.buffer.api.Matchers.contentEqualTo) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Nullable(javax.annotation.Nullable) SMALLEST_MAX_CONCURRENT_STREAMS(io.netty.handler.codec.http2.Http2CodecUtil.SMALLEST_MAX_CONCURRENT_STREAMS) DEFAULT(io.servicetalk.http.netty.HttpTestExecutionStrategy.DEFAULT) Single(io.servicetalk.concurrent.api.Single) StringWriter(java.io.StringWriter) Completable(io.servicetalk.concurrent.api.Completable) DefaultHttp2HeadersFrame(io.netty.handler.codec.http2.DefaultHttp2HeadersFrame) IOException(java.io.IOException) ReservedBlockingHttpConnection(io.servicetalk.http.api.ReservedBlockingHttpConnection) OK(io.servicetalk.http.api.HttpResponseStatus.OK) GET(io.servicetalk.http.api.HttpRequestMethod.GET) Channel(io.netty.channel.Channel) Http2Settings(io.netty.handler.codec.http2.Http2Settings) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) String.valueOf(java.lang.String.valueOf) Completable.completed(io.servicetalk.concurrent.api.Completable.completed) Http2MultiplexHandler(io.netty.handler.codec.http2.Http2MultiplexHandler) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) HttpResponseStatus(io.servicetalk.http.api.HttpResponseStatus) HostAndPort(io.servicetalk.transport.api.HostAndPort) HttpRequestMethod(io.servicetalk.http.api.HttpRequestMethod) Matchers.emptyString(org.hamcrest.Matchers.emptyString) Http2FrameCodecBuilder(io.netty.handler.codec.http2.Http2FrameCodecBuilder) Key.newKey(io.servicetalk.context.api.ContextMap.Key.newKey) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2DataFrame(io.netty.handler.codec.http2.Http2DataFrame) MethodSource(org.junit.jupiter.params.provider.MethodSource) ChannelDuplexHandler(io.netty.channel.ChannelDuplexHandler) ChannelInitializer(io.netty.channel.ChannelInitializer) PublisherSource(io.servicetalk.concurrent.PublisherSource) CONTENT_LENGTH(io.servicetalk.http.api.HttpHeaderNames.CONTENT_LENGTH) InetSocketAddress(java.net.InetSocketAddress) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) HttpEventKey(io.servicetalk.http.api.HttpEventKey) List(java.util.List) ContextMap(io.servicetalk.context.api.ContextMap) DelegatingConnectionAcceptor(io.servicetalk.transport.api.DelegatingConnectionAcceptor) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Writer(java.io.Writer) Queue(java.util.Queue) CONTINUE(io.servicetalk.http.api.HttpHeaderValues.CONTINUE) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) StreamingHttpResponse(io.servicetalk.http.api.StreamingHttpResponse) Publisher(io.servicetalk.concurrent.api.Publisher) Http2Exception(io.servicetalk.http.api.Http2Exception) AtomicReference(java.util.concurrent.atomic.AtomicReference) StreamingHttpServiceFilter(io.servicetalk.http.api.StreamingHttpServiceFilter) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) HttpProtocolConfigs.h1Default(io.servicetalk.http.netty.HttpProtocolConfigs.h1Default) HttpProtocolConfigs.h2Default(io.servicetalk.http.netty.HttpProtocolConfigs.h2Default) HttpSerializers.textSerializerUtf8(io.servicetalk.http.api.HttpSerializers.textSerializerUtf8) HttpExecutionStrategy(io.servicetalk.http.api.HttpExecutionStrategy) NettyConnectionContext(io.servicetalk.transport.netty.internal.NettyConnectionContext) DELIBERATE_EXCEPTION(io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION) HttpServerBuilder(io.servicetalk.http.api.HttpServerBuilder) ConnectionContext(io.servicetalk.transport.api.ConnectionContext) INTERNAL_SERVER_ERROR(io.servicetalk.http.api.HttpResponseStatus.INTERNAL_SERVER_ERROR) AddressUtils.localAddress(io.servicetalk.transport.netty.internal.AddressUtils.localAddress) EventLoopGroup(io.netty.channel.EventLoopGroup) ServerContext(io.servicetalk.transport.api.ServerContext) Iterator(java.util.Iterator) EXPECTATION_FAILED(io.servicetalk.http.api.HttpResponseStatus.EXPECTATION_FAILED) NettyIoExecutors.createIoExecutor(io.servicetalk.transport.netty.internal.NettyIoExecutors.createIoExecutor) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Processors.newPublisherProcessor(io.servicetalk.concurrent.api.Processors.newPublisherProcessor) Consumer(java.util.function.Consumer) Matchers.emptyIterable(org.hamcrest.Matchers.emptyIterable) StreamingHttpResponseFactory(io.servicetalk.http.api.StreamingHttpResponseFactory) NO_OFFLOAD(io.servicetalk.http.netty.HttpTestExecutionStrategy.NO_OFFLOAD) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) ChannelHandler(io.netty.channel.ChannelHandler) SET_COOKIE(io.servicetalk.http.api.HttpHeaderNames.SET_COOKIE) DefaultHttpCookiePair(io.servicetalk.http.api.DefaultHttpCookiePair) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Http2SettingsAckFrame(io.netty.handler.codec.http2.Http2SettingsAckFrame) StreamingHttpClient(io.servicetalk.http.api.StreamingHttpClient) InetSocketAddress(java.net.InetSocketAddress) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) ConsumableEvent(io.servicetalk.client.api.ConsumableEvent) ChannelInitializer(io.netty.channel.ChannelInitializer) Http2Settings(io.netty.handler.codec.http2.Http2Settings) Buffer(io.servicetalk.buffer.api.Buffer) FilterableStreamingHttpConnection(io.servicetalk.http.api.FilterableStreamingHttpConnection) DefaultHttp2SettingsFrame(io.netty.handler.codec.http2.DefaultHttp2SettingsFrame) BuilderUtils.serverChannel(io.servicetalk.transport.netty.internal.BuilderUtils.serverChannel) Channel(io.netty.channel.Channel) AtomicReference(java.util.concurrent.atomic.AtomicReference) Publisher(io.servicetalk.concurrent.api.Publisher) CountDownLatch(java.util.concurrent.CountDownLatch) H2StreamResetException(io.servicetalk.http.netty.NettyHttp2ExceptionUtils.H2StreamResetException) IOException(java.io.IOException) Http2Exception(io.servicetalk.http.api.Http2Exception) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ChannelInboundHandlerAdapter(io.netty.channel.ChannelInboundHandlerAdapter) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

Processor (io.servicetalk.concurrent.PublisherSource.Processor)3 Processors.newPublisherProcessor (io.servicetalk.concurrent.api.Processors.newPublisherProcessor)3 SourceAdapters.fromSource (io.servicetalk.concurrent.api.SourceAdapters.fromSource)3 PublisherSource (io.servicetalk.concurrent.PublisherSource)2 Subscriber (io.servicetalk.concurrent.PublisherSource.Subscriber)2 Subscription (io.servicetalk.concurrent.PublisherSource.Subscription)2 Publisher.failed (io.servicetalk.concurrent.api.Publisher.failed)2 Publisher.from (io.servicetalk.concurrent.api.Publisher.from)2 Single.succeeded (io.servicetalk.concurrent.api.Single.succeeded)2 SourceAdapters.toSource (io.servicetalk.concurrent.api.SourceAdapters.toSource)2 DeliberateException (io.servicetalk.concurrent.internal.DeliberateException)2 DELIBERATE_EXCEPTION (io.servicetalk.concurrent.internal.DeliberateException.DELIBERATE_EXCEPTION)2 TestPublisherSubscriber (io.servicetalk.concurrent.test.internal.TestPublisherSubscriber)2 PlatformDependent.throwException (io.servicetalk.utils.internal.PlatformDependent.throwException)2 ArrayList (java.util.ArrayList)2 Arrays.asList (java.util.Arrays.asList)2 List (java.util.List)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 Future (java.util.concurrent.Future)2 MILLISECONDS (java.util.concurrent.TimeUnit.MILLISECONDS)2