Search in sources :

Example 6 with Counter

use of com.oath.cyclops.types.reactive.QueueBasedSubscriber.Counter in project cyclops by aol.

the class ReactiveSeq method enqueued.

static <T> ReactiveSeq<T> enqueued(QueueFactory<T> factory, Consumer<? super Subscriber<T>>... subs) {
    final Counter c = new Counter();
    c.active.set(subs.length);
    QueueBasedSubscriber<T> s = QueueBasedSubscriber.subscriber(factory, c, subs.length);
    for (Consumer<? super Subscriber<T>> next : subs) next.accept(s);
    return s.reactiveSeq();
}
Also used : Counter(com.oath.cyclops.types.reactive.QueueBasedSubscriber.Counter)

Aggregations

Counter (com.oath.cyclops.types.reactive.QueueBasedSubscriber.Counter)6 Continuation (com.oath.cyclops.types.futurestream.Continuation)2 Publisher (org.reactivestreams.Publisher)2 com.oath.cyclops.async (com.oath.cyclops.async)1 com.oath.cyclops.async.adapters (com.oath.cyclops.async.adapters)1 Queue (com.oath.cyclops.async.adapters.Queue)1 DataWitness.reactiveSeq (com.oath.cyclops.hkt.DataWitness.reactiveSeq)1 Higher (com.oath.cyclops.hkt.Higher)1 OneShotStreamX (com.oath.cyclops.internal.stream.OneShotStreamX)1 com.oath.cyclops.internal.stream.spliterators (com.oath.cyclops.internal.stream.spliterators)1 ReversingDoubleArraySpliterator (com.oath.cyclops.internal.stream.spliterators.doubles.ReversingDoubleArraySpliterator)1 ReversingIntArraySpliterator (com.oath.cyclops.internal.stream.spliterators.ints.ReversingIntArraySpliterator)1 ReversingRangeIntSpliterator (com.oath.cyclops.internal.stream.spliterators.ints.ReversingRangeIntSpliterator)1 ReversingLongArraySpliterator (com.oath.cyclops.internal.stream.spliterators.longs.ReversingLongArraySpliterator)1 ReversingRangeLongSpliterator (com.oath.cyclops.internal.stream.spliterators.longs.ReversingRangeLongSpliterator)1 Unit (com.oath.cyclops.types.factory.Unit)1 Contains (com.oath.cyclops.types.foldable.Contains)1 To (com.oath.cyclops.types.foldable.To)1 ReactiveTransformable (com.oath.cyclops.types.functor.ReactiveTransformable)1 PersistentCollection (com.oath.cyclops.types.persistent.PersistentCollection)1