Tabnine Logo
QueueFactories.unboundedQueue
Code IndexAdd Tabnine to your IDE (free)

How to use
unboundedQueue
method
in
com.oath.cyclops.async.QueueFactories

Best Java code snippets using com.oath.cyclops.async.QueueFactories.unboundedQueue (Showing top 8 results out of 315)

origin: aol/cyclops

/**
 * Construct a Topic using the Queue provided
 * @param q Queue to back this Topic with
 */
public Topic(final Queue<T> q) {
  factory = QueueFactories.unboundedQueue();
  distributor.addQueue(q);
}
public Topic(final Queue<T> q,QueueFactory<T> factory) {
origin: aol/cyclops

/**
 * Construct a new Topic
 */
public Topic() {
  final Queue<T> q = new Queue<T>();
  factory = QueueFactories.unboundedQueue();
  distributor.addQueue(q);
}
origin: aol/cyclops

@Test
public void adapter(){
  Adapter<Integer> adapter = QueueFactories.<Integer>unboundedQueue()
                            .build();
    String result =   Eithers.adapter(adapter)
                     .fold(queue->"we have a queue", topic->"we have a topic");
    assertThat(result,equalTo("we have a queue"));
}
origin: com.oath.cyclops/cyclops

/**
 * Construct a Topic using the Queue provided
 * @param q Queue to back this Topic with
 */
public Topic(final Queue<T> q) {
  factory = QueueFactories.unboundedQueue();
  distributor.addQueue(q);
}
public Topic(final Queue<T> q,QueueFactory<T> factory) {
origin: com.oath.cyclops/cyclops-futurestream

public SimpleReactStreamImpl(final SimpleReact simpleReact, final Stream<CompletableFuture<U>> stream) {
  this.simpleReact = simpleReact;
  final Stream s = stream;
  this.errorHandler = Optional.empty();
  this.lastActive = new EagerStreamWrapper(
                       s, this.errorHandler);
  this.queueFactory = QueueFactories.unboundedQueue();
  this.subscription = new AlwaysContinue();
}
origin: com.oath.cyclops/cyclops

/**
 * Construct a new Topic
 */
public Topic() {
  final Queue<T> q = new Queue<T>();
  factory = QueueFactories.unboundedQueue();
  distributor.addQueue(q);
}
origin: com.oath.cyclops/cyclops-futurestream

this.withQueueFactory(QueueFactories.unboundedQueue())
  .toQueue(q -> q.withTimeout(100)
         .withTimeUnit(TimeUnit.MICROSECONDS)),
origin: com.oath.cyclops/cyclops-futurestream

/**
 * @return a Stream that batches all completed elements from this stream since last read recover into a collection
 */
default FutureStream<Collection<U>> chunkSinceLastRead() {
  final Queue queue = this.withQueueFactory(QueueFactories.unboundedQueue())
              .toQueue();
  final Queue.QueueReader reader = new Queue.QueueReader(
                              queue, null);
  class Chunker implements Iterator<Collection<U>> {
    @Override
    public boolean hasNext() {
      return reader.isOpen();
    }
    @Override
    public Collection<U> next() {
      return reader.drainToOrBlock();
    }
  }
  final Chunker chunker = new Chunker();
  final Function<Supplier<U>, Supplier<Collection<U>>> fn = s -> {
    return () -> {
      try {
        return chunker.next();
      } catch (final ClosedQueueException e) {
        throw new ClosedQueueException();
      }
    };
  };
  return fromStream(queue.streamBatchNoTimeout(getSubscription(), fn));
}
com.oath.cyclops.asyncQueueFactoriesunboundedQueue

Javadoc

 
ReactiveSeq.of(1,2,3)

Popular methods of QueueFactories

  • boundedNonBlockingQueue
    Generate QueueFactory for bounded non blocking queues. Max queue size is determined by the input par
  • unboundedNonBlockingQueue
    Creates an async.Queue backed by a JDK Wait Free unbounded ConcurrentLinkedQueue The provided WaitSt
  • boundedQueue
    Create a QueueFactory for boundedQueues where bound is determined by the provided queueSize paramete

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • startActivity (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best IntelliJ plugins
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