/** * A potentially asynchronous merge operation where data from each publisher may arrive out of order (if publishers * are configured to publish asynchronously. * The QueueFactory parameter can be used by pull based Streams to control the maximum queued elements @see {@link QueueFactories} * Push based reactive-streams signal demand via their subscription. * * */ @Deprecated //name will be refactored to merge in the future default ReactiveSeq<T> mergeP(final QueueFactory<T> factory,final Publisher<T>... publishers) { final Counter c = new Counter(); c.active.set(publishers.length + 1); final QueueBasedSubscriber<T> init = QueueBasedSubscriber.subscriber(factory, c, publishers.length); final Supplier<Continuation> sp = () -> { subscribe(init); for (final Publisher next : publishers) { next.subscribe(QueueBasedSubscriber.subscriber(init.getQueue(), c, publishers.length)); } init.close(); return Continuation.empty(); }; final Continuation continuation = new Continuation( sp); init.addContinuation(continuation); return ReactiveSeq.fromStream(init.jdkStream()); } default ReactiveSeq<T> publishTo(Adapter<T>... adapters){
/** * A potentially asynchronous merge operation where data from each publisher may arrive out of order (if publishers * are configured to publish asynchronously. * The QueueFactory parameter can be used by pull based Streams to control the maximum queued elements @see {@link QueueFactories} * Push based reactive-streams signal demand via their subscription. * * */ @Deprecated //name will be refactored to merge in the future default ReactiveSeq<T> mergeP(final QueueFactory<T> factory,final Publisher<T>... publishers) { final Counter c = new Counter(); c.active.set(publishers.length + 1); final QueueBasedSubscriber<T> init = QueueBasedSubscriber.subscriber(factory, c, publishers.length); final Supplier<Continuation> sp = () -> { subscribe(init); for (final Publisher next : publishers) { next.subscribe(QueueBasedSubscriber.subscriber(init.getQueue(), c, publishers.length)); } init.close(); return Continuation.empty(); }; final Continuation continuation = new Continuation( sp); init.addContinuation(continuation); return ReactiveSeq.fromStream(init.jdkStream()); } default ReactiveSeq<T> publishTo(Adapter<T>... adapters){