@Test void testOnClosedChannel() { PeriodicalChannel pc = new PeriodicalChannel(i -> 1024, TEST_DATA_SIZE); pc.close(); Multi<ByteBuffer> publisher = IoMulti.multiFromByteChannelBuilder(pc) .retrySchema(RetrySchema.constant(0)) .build(); try { Multi.create(publisher) .collect(new BufferCollector()) .await(5, TimeUnit.SECONDS); fail("Did not throw expected CompletionException!"); } catch (CompletionException e) { assertThat(e.getCause(), instanceOf(ClosedChannelException.class)); } MultiFromByteChannel multi = (MultiFromByteChannel) publisher; LazyValue<ScheduledExecutorService> executor = multi.executor(); assertThat("Executor should have not been used", executor.isLoaded(), is(false)); }
LazyValue<ScheduledExecutorService> executor() { return executor; }
MultiFromByteChannel implements Multi<ByteBuffer> { LazyValue<ScheduledExecutorService> executor() { return executor; } }
MultiFromByteChannel implements Multi<ByteBuffer> { LazyValue<ScheduledExecutorService> executor() { return executor; } MultiFromByteChannel(IoMulti.MultiFromByteChannelBuilder builder); }
MultiFromByteChannel implements Multi<ByteBuffer> { LazyValue<ScheduledExecutorService> executor() { return executor; } MultiFromByteChannel(IoMulti.MultiFromByteChannelBuilder builder); @Override void subscribe(Flow.Subscriber<? super ByteBuffer> subscriberParam); }
MultiFromByteChannel implements Multi<ByteBuffer> { LazyValue<ScheduledExecutorService> executor() { return executor; } MultiFromByteChannel(IoMulti.MultiFromByteChannelBuilder builder); @Override void subscribe(Flow.Subscriber<? super ByteBuffer> subscriberParam);  }