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();
}
Aggregations