congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
com.oath.cyclops.types.reactive
Code IndexAdd Tabnine to your IDE (free)

How to use com.oath.cyclops.types.reactive

Best Java code snippets using com.oath.cyclops.types.reactive (Showing top 20 results out of 315)

origin: aol/cyclops

/**
 * Create an Subscriber for Observable style asynchronous push based Streams.
 * Streams generated from AsyncSubscribers are not backpressure aware (in cases
 * where backpressue is not needed they may perform better).
 * For backpressure aware Streams see {@link Spouts#reactiveSubscriber}
 *
 * @param <T> Stream data type
 * @return Async Stream Subscriber
 */
static <T> AsyncSubscriber<T> asyncSubscriber(){
  return new AsyncSubscriber<T>();
}
origin: aol/cyclops

public static <T> ValueSubscriber<T> subscriber() {
  return new ValueSubscriber<>(
                 () -> {
                 });
}
origin: aol/cyclops

/**
 * Create a QueueBasedSubscriber, backed by a JDK LinkedBlockingQueue
 *
 * @param counter Counter for tracking connections to the queue and data volumes
 * @param maxConcurrency Maximum number of subscriptions
 * @return QueueBasedSubscriber
 */
public static <T> QueueBasedSubscriber<T> subscriber(final Counter counter, final int maxConcurrency) {
  return new QueueBasedSubscriber<>(
      counter, maxConcurrency);
}
origin: aol/cyclops

static <T> ReactiveSeq<T> enqueuedAll(Consumer<? super Subscriber<T>>... subs){
  final Counter c = new Counter();
  c.active.set(subs.length);
  QueueBasedSubscriber<T> s = QueueBasedSubscriber.subscriber(c,subs.length);
  for(Consumer<? super Subscriber<T>> next : subs)
    next.accept(s);
  s.close();
  return s.reactiveSeq();
}
static <T> ReactiveSeq<T> enqueued(Queue<T> q,Consumer<? super Subscriber<T>> sub){
origin: aol/cyclops

static <T> ReactiveSeq<T> enqueued(Queue<T> q,Consumer<? super Subscriber<T>> sub){
  final Counter c = new Counter();
  c.active.set(1);
  QueueBasedSubscriber<T> s = QueueBasedSubscriber.subscriber(q,c,1);
  sub.accept(s);
  return s.reactiveSeq();
}
static <T> ReactiveSeq<T> enqueued(QueueFactory<T> factory, Consumer<? super Subscriber<T>>... subs){
origin: aol/cyclops

@Override
public Subscriber<Long> createSubscriber() {
  return new QueueBasedSubscriber(new QueueBasedSubscriber.Counter(),500);
}
origin: aol/cyclops

  @Override
  public void onComplete() {
    PushSubscriber.this.onComplete();
  }
};
origin: aol/cyclops

@Override
public void onNext(T t) {
  PushSubscriber.this.onNext(t);
}
origin: aol/cyclops

@Override
default <X extends Throwable> Subscription forEachSubscribe(Consumer<? super T> consumer, Consumer<? super Throwable> consumerError){
  Subscription result = ReactiveStreamsTerminalOperations.super.forEachSubscribe(consumer,consumerError,()->{});
  return result;
}
origin: aol/cyclops

/**
 * Request all elements to be processed from the processing Stream
 */
public void requestAll() {
  request(Long.MAX_VALUE);
}
origin: aol/cyclops

/**
 * Request all elements to be processed asynchronously in the processing stream
 *
 * @return New ReactiveTask that references the execution of the new async task
 */
public ReactiveTask requestAllAsync() {
  return requestAsync(Long.MAX_VALUE);
}
origin: aol/cyclops

@Override
public void onError(Throwable t) {
  PushSubscriber.this.onError(t);
}
origin: aol/cyclops

/**
 *   The recommended way to connect a Spout to a Publisher is via Spouts#from
 *   Create an Subscriber for Observable style asynchronous push based Streams,
 *   that implements backpressure internally via the reactive-streams spec.
 *
 *   Subscribers signal demand via their subscription and publishers push data to subscribers
 *   synchronously or asynchronously, never exceeding signalled demand
 *
 * @param <T> Stream data type
 * @return An async Stream Subscriber that supports efficient backpressure via reactive-streams
 */
static <T> ReactiveSubscriber<T> reactiveSubscriber(){
  return new ReactiveSubscriber<T>();
}
origin: aol/cyclops

@Override
public void onNext(Long aLong) {
  probe.registerOnNext(aLong);
  super.onNext(aLong);
}
origin: aol/cyclops

  @Override
  public void onComplete() {
    probe.registerOnComplete();
    super.onComplete();
  }
};
origin: aol/cyclops

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();
}
origin: aol/cyclops

/**
 * Create a QueueBasedSubscriber, backed by the provided Queue
 *
 * @param q Queue backing the reactiveSubscriber
 * @param counter Counter for tracking connections to the queue and data volumes
 * @param maxConcurrency Maximum number of subscriptions
 * @return QueueBasedSubscriber
 */
public static <T> QueueBasedSubscriber<T> subscriber(final Queue<T> q, final Counter counter, final int maxConcurrency) {
  return new QueueBasedSubscriber<>(
      q, counter, maxConcurrency);
}
origin: aol/cyclops

public static <T> ValueSubscriber<T> subscriber(final Runnable onComplete) {
  return new ValueSubscriber<>(
                 onComplete);
}
origin: aol/cyclops

@Override
default <X extends Throwable> Subscription forEachSubscribe(Consumer<? super T> consumer, Consumer<? super Throwable> consumerError, Runnable onComplete){
  Subscription result = ReactiveStreamsTerminalOperations.super.forEachSubscribe(consumer,consumerError,onComplete);
  return result;
}
@Override
origin: aol/cyclops

/**
 * Create a QueueBasedSubscriber, backed by a Queue that will be created with the provided QueueFactory
 *
 * @param factory QueueFactory
 * @param counter Counter for tracking connections to the queue and data volumes
 * @param maxConcurrency Maximum number of subscriptions
 * @return QueueBasedSubscriber
 */
public static <T> QueueBasedSubscriber<T> subscriber(final QueueFactory<T> factory, final Counter counter, final int maxConcurrency) {
  return new QueueBasedSubscriber<>(
      factory, counter, maxConcurrency);
}
com.oath.cyclops.types.reactive

Most used classes

  • QueueBasedSubscriber
    A reactive-streams reactiveSubscriber, backed by a cyclops2-react async.Queue, for merging data from
  • ValueSubscriber
    A reactive-streams Subscriber that can take 1 value from a reactive-streams publisher and convert it
  • AsyncSubscriber
    A subscriber for Observable type Streams that avoid the overhead of applying backpressure. For backp
  • PushSubscriber
  • QueueBasedSubscriber$2
  • ReactiveSubscriber,
  • ReactiveTask,
  • BufferOverflowPolicy,
  • ReactiveStreamsTerminalOperations,
  • Completable,
  • FutureStreamSynchronousPublisher$1,
  • FutureStreamSynchronousPublisher
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now