@Test public void fromFlowCancel() { AtomicReference<Subscription> receivedSubscription = new AtomicReference<>(); Publisher<Integer> flowPublisher = newMockFlowPublisher((__, subscription) -> receivedSubscription.set(subscription)); fromFlowPublisher(flowPublisher).firstOrElse(() -> null).toFuture().cancel(true); Subscription subscription = receivedSubscription.get(); assertThat("Subscription not received.", subscription, is(notNullValue())); verify(subscription).cancel(); }
public static <T> Publisher<T> fromFlowPublisher(java.util.concurrent.Flow.Publisher<T> source) { return new FlowToStPublisher<>(source); }
JdkFlowAdapters { public static <T> Publisher<T> fromFlowPublisher(java.util.concurrent.Flow.Publisher<T> source) { return new FlowToStPublisher<>(source); } }
JdkFlowAdapters { public static <T> Publisher<T> fromFlowPublisher(java.util.concurrent.Flow.Publisher<T> source) { return new FlowToStPublisher<>(source); } private  JdkFlowAdapters(); }
JdkFlowAdapters { public static <T> Publisher<T> fromFlowPublisher(java.util.concurrent.Flow.Publisher<T> source) { return new FlowToStPublisher<>(source); } private  JdkFlowAdapters(); static Publisher<T> fromFlowPublisher(java.util.concurrent.Flow.Publisher<T> source); static java.util.concurrent.Flow.Publisher<T> toFlowPublisher(Publisher<T> publisher); static java.util.concurrent.Flow.Publisher<T> toFlowPublisher(PublisherSource<T> source); }
JdkFlowAdapters { public static <T> Publisher<T> fromFlowPublisher(java.util.concurrent.Flow.Publisher<T> source) { return new FlowToStPublisher<>(source); } private  JdkFlowAdapters(); static Publisher<T> fromFlowPublisher(java.util.concurrent.Flow.Publisher<T> source); static java.util.concurrent.Flow.Publisher<T> toFlowPublisher(Publisher<T> publisher); static java.util.concurrent.Flow.Publisher<T> toFlowPublisher(PublisherSource<T> source);  }