com.lmax.disruptor
Enum WaitStrategy.Option

java.lang.Object
  extended by java.lang.Enum<WaitStrategy.Option>
      extended by com.lmax.disruptor.WaitStrategy.Option
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<WaitStrategy.Option>
Enclosing interface:
WaitStrategy

public static enum WaitStrategy.Option
extends java.lang.Enum<WaitStrategy.Option>

Strategy options which are available to those waiting on a RingBuffer


Enum Constant Summary
BLOCKING
          This strategy uses a condition variable inside a lock to block the consumer which saves CPU resource as the expense of lock contention.
BUSY_SPIN
          This strategy call spins in a loop as a waiting strategy which is lowest and most consistent latency but ties up a CPU
YIELDING
          This strategy calls Thread.yield() in a loop as a waiting strategy which reduces contention at the expense of CPU resource.
 
Method Summary
static WaitStrategy.Option valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static WaitStrategy.Option[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BLOCKING

public static final WaitStrategy.Option BLOCKING
This strategy uses a condition variable inside a lock to block the consumer which saves CPU resource as the expense of lock contention.


YIELDING

public static final WaitStrategy.Option YIELDING
This strategy calls Thread.yield() in a loop as a waiting strategy which reduces contention at the expense of CPU resource.


BUSY_SPIN

public static final WaitStrategy.Option BUSY_SPIN
This strategy call spins in a loop as a waiting strategy which is lowest and most consistent latency but ties up a CPU

Method Detail

values

public static WaitStrategy.Option[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (WaitStrategy.Option c : WaitStrategy.Option.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WaitStrategy.Option valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


Copyright © 2011 LMAX Ltd. All Rights Reserved.