Tabnine Logo
AbstractNodeQueue
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractNodeQueue
in
akka.dispatch

Best Java code snippets using akka.dispatch.AbstractNodeQueue (Showing top 20 results out of 315)

origin: com.typesafe.akka/akka-actor_2.12

/**
 * Query the queue whether it is empty right now.
 * 
 * This method can be used from any thread.
 * 
 * @return true if queue was empty at some point in the past
 */
public final boolean isEmpty() {
  return Unsafe.instance.getObjectVolatile(this, tailOffset) == get();
}
origin: com.typesafe.akka/akka-actor_2.11

/**
 * Add an element to the head of the queue, providing the queue node to be used.
 * 
 * This method can be used from any thread.
 * 
 * @param n the node containing the element to be added; both must not be null
 */
public final void addNode(final Node<T> n) {
  n.setNext(null);
  getAndSet(n).setNext(n);
}
origin: com.typesafe.akka/akka-actor_2.11

/**
 * Query the queue tail for the next element without dequeuing it.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return element if there was one, or null if there was none
 */
public final T peek() {
  final Node<T> n = peekNode();
  return (n != null) ? n.value : null;
}
origin: com.typesafe.akka/akka-actor_2.12

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
origin: com.typesafe.akka/akka-actor_2.10

/**
 * Pull one item from the queue’s tail if there is one.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return element if there was one, or null if there was none
 */
public final T poll() {
  final Node<T> next = pollNode();
  if (next == null) return null;
  else {
   T value = next.value;
   next.value = null;
   return value;
  }
}

origin: com.typesafe.akka/akka-actor_2.10

/**
 * Query the queue whether it is empty right now.
 * 
 * This method can be used from any thread.
 * 
 * @return true if queue was empty at some point in the past
 */
public final boolean isEmpty() {
  return peek() == null;
}
origin: com.typesafe.akka/akka-actor_2.11

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
origin: com.typesafe.akka/akka-actor_2.11

/**
 * Pull one item from the queue’s tail if there is one.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return element if there was one, or null if there was none
 */
public final T poll() {
  final Node<T> next = pollNode();
  if (next == null) return null;
  else {
   T value = next.value;
   next.value = null;
   return value;
  }
}

origin: com.data-artisans/flakka-actor_2.11

/**
 * Query the queue whether it is empty right now.
 * 
 * This method can be used from any thread.
 * 
 * @return true if queue was empty at some point in the past
 */
public final boolean isEmpty() {
  return peek() == null;
}
origin: com.typesafe.akka/akka-actor

/**
 * Query the queue whether it is empty right now.
 * 
 * This method can be used from any thread.
 * 
 * @return true if queue was empty at some point in the past
 */
public final boolean isEmpty() {
  return Unsafe.instance.getObjectVolatile(this, tailOffset) == get();
}
origin: com.typesafe.akka/akka-actor_2.10

/**
 * Add an element to the head of the queue.
 * 
 * This method can be used from any thread.
 * 
 * @param value the element to be added; must not be null
 */
public final void add(final T value) {
  final Node<T> n = new Node<T>(value);
  getAndSet(n).setNext(n);
}

origin: com.typesafe.akka/akka-actor_2.10

/**
 * Query the queue tail for the next element without dequeuing it.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return element if there was one, or null if there was none
 */
public final T peek() {
  final Node<T> n = peekNode();
  return (n != null) ? n.value : null;
}
origin: com.typesafe.akka/akka-actor_2.10

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
origin: com.typesafe.akka/akka-actor_2.12

/**
 * Pull one item from the queue’s tail if there is one.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return element if there was one, or null if there was none
 */
public final T poll() {
  final Node<T> next = pollNode();
  if (next == null) return null;
  else {
   T value = next.value;
   next.value = null;
   return value;
  }
}

origin: com.data-artisans/flakka-actor_2.10

/**
 * Query the queue whether it is empty right now.
 * 
 * This method can be used from any thread.
 * 
 * @return true if queue was empty at some point in the past
 */
public final boolean isEmpty() {
  return peek() == null;
}
origin: com.typesafe.akka/akka-actor_2.11

/**
 * Query the queue whether it is empty right now.
 * 
 * This method can be used from any thread.
 * 
 * @return true if queue was empty at some point in the past
 */
public final boolean isEmpty() {
  return Unsafe.instance.getObjectVolatile(this, tailOffset) == get();
}
origin: com.typesafe.akka/akka-actor_2.10

/**
 * Add an element to the head of the queue, providing the queue node to be used.
 * 
 * This method can be used from any thread.
 * 
 * @param n the node containing the element to be added; both must not be null
 */
public final void addNode(final Node<T> n) {
  n.setNext(null);
  getAndSet(n).setNext(n);
}
origin: com.typesafe.akka/akka-actor_2.12

/**
 * Query the queue tail for the next element without dequeuing it.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return element if there was one, or null if there was none
 */
public final T peek() {
  final Node<T> n = peekNode();
  return (n != null) ? n.value : null;
}
origin: com.typesafe.akka/akka-actor

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
origin: com.typesafe.akka/akka-actor

/**
 * Pull one item from the queue’s tail if there is one.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return element if there was one, or null if there was none
 */
public final T poll() {
  final Node<T> next = pollNode();
  if (next == null) return null;
  else {
   T value = next.value;
   next.value = null;
   return value;
  }
}

akka.dispatchAbstractNodeQueue

Javadoc

Lock-free MPSC linked queue implementation based on Dmitriy Vyukov's non-intrusive MPSC queue: http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue

Most used methods

  • get
  • getAndSet
  • peekNode
    Query the queue tail for the next element without dequeuing it. Use this method only from the consum
  • set
  • pollNode
    Pull one item from the queue, returning it within a queue node. Use this method only from the consum
  • peek
    Query the queue tail for the next element without dequeuing it. Use this method only from the consum

Popular in Java

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • compareTo (BigDecimal)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JComboBox (javax.swing)
  • Top plugins for WebStorm
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