@Test void chunky() throws Exception { PeriodicalChannel pc = createChannelWithNoAvailableData(25, 3); ReadableByteChannelPublisher publisher = new ReadableByteChannelPublisher(pc, RetrySchema.constant(2)); byte[] bytes = ContentReaders.readBytes(publisher).get(5, TimeUnit.SECONDS); assertThat(bytes.length, is(TEST_DATA_SIZE)); assertByteSequence(bytes); assertThat(pc.threads.size(), is(2)); assertThat(pc.isOpen(), is(false)); LazyValue<ScheduledExecutorService> executor = publisher.executor(); assertThat("Executor should have been used", executor.isLoaded(), is(true)); assertThat("Executor should have been shut down", executor.get().isShutdown(), is(true)); }
LazyValue<ScheduledExecutorService> executor() { return executor; }
ReadableByteChannelPublisher implements Flow.Publisher<DataChunk> { LazyValue<ScheduledExecutorService> executor() { return executor; } }
ReadableByteChannelPublisher implements Flow.Publisher<DataChunk> { LazyValue<ScheduledExecutorService> executor() { return executor; } @Deprecated(since = "2.0.0", forRemoval = true)  ReadableByteChannelPublisher(ReadableByteChannel channel, RetrySchema retrySchema); }
ReadableByteChannelPublisher implements Flow.Publisher<DataChunk> { LazyValue<ScheduledExecutorService> executor() { return executor; } @Deprecated(since = "2.0.0", forRemoval = true)  ReadableByteChannelPublisher(ReadableByteChannel channel, RetrySchema retrySchema); @Override void subscribe(Flow.Subscriber<? super DataChunk> subscriberParam); }
ReadableByteChannelPublisher implements Flow.Publisher<DataChunk> { LazyValue<ScheduledExecutorService> executor() { return executor; } @Deprecated(since = "2.0.0", forRemoval = true)  ReadableByteChannelPublisher(ReadableByteChannel channel, RetrySchema retrySchema); @Override void subscribe(Flow.Subscriber<? super DataChunk> subscriberParam);  }