|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.jdon.async.disruptor.DisruptorFactory
public class DisruptorFactory
SLEEPING is a better option when you have a large number of event processors and you need throughput when you don't mind a 1ms latency hit in the worse case. BLOCKING has the lowest throughput of all the strategies but it does not have the 1ms latency spikes of SLEEPING. It uses no CPU when idle but it does not scale up so well with increasing numbers of event processors because of the contention on the lock. YIELDING and BUSY_SPIN have the best performance for both throughput and latency but eat up a CPU. YIELDING is more friendly in allowing other threads to run when cores are limited. It would be nice if Java had access to the x86 PAUSE instruction to save power and further reduce latency that gets lost due to the wrong choices the CPU can make with speculative execution of busy spin loops. In all cases where you have sufficient cores then all the wait strategies will beat pretty much any other alternative such as queues.
| 字段摘要 | |
|---|---|
protected ConcurrentHashMap<String,TreeSet<DomainEventHandler>> |
handlesMap
|
static String |
module
|
| 构造方法摘要 | |
|---|---|
DisruptorFactory()
|
|
DisruptorFactory(DisruptorParams disruptorParams,
ContainerCallback containerCallback,
DisruptorPoolFactory disruptorPoolFactory)
|
|
| 方法摘要 | |
|---|---|
com.lmax.disruptor.dsl.Disruptor |
addEventMessageHandler(com.lmax.disruptor.dsl.Disruptor dw,
String topic,
TreeSet<DomainEventHandler> handlers)
|
com.lmax.disruptor.dsl.Disruptor |
createDisruptor(String topic)
one topic one EventDisruptor |
com.lmax.disruptor.dsl.Disruptor |
createDw(String topic)
|
com.lmax.disruptor.dsl.Disruptor |
createSingleDisruptor(String topic)
single producer :single consumer no lock |
com.lmax.disruptor.dsl.Disruptor |
createSingleDw(String topic)
|
com.lmax.disruptor.dsl.Disruptor |
getDisruptor(String topic)
|
com.lmax.disruptor.dsl.Disruptor |
getDisruptorSingle(String topic)
|
TreeSet<DomainEventHandler> |
getTreeSet()
|
boolean |
isContain(String topic)
|
protected Collection |
loadEvenHandler(String topic)
if there are many consumers, execution order will be alphabetical list by Name of @Consumer class. |
protected Collection |
loadOnEventConsumers(String topic)
|
void |
releaseDisruptor(Object owner)
|
void |
start()
Start this component. |
void |
stop()
Stop this component. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final String module
protected final ConcurrentHashMap<String,TreeSet<DomainEventHandler>> handlesMap
| 构造方法详细信息 |
|---|
public DisruptorFactory(DisruptorParams disruptorParams,
ContainerCallback containerCallback,
DisruptorPoolFactory disruptorPoolFactory)
public DisruptorFactory()
| 方法详细信息 |
|---|
public com.lmax.disruptor.dsl.Disruptor createDw(String topic)
public com.lmax.disruptor.dsl.Disruptor createSingleDw(String topic)
public com.lmax.disruptor.dsl.Disruptor addEventMessageHandler(com.lmax.disruptor.dsl.Disruptor dw,
String topic,
TreeSet<DomainEventHandler> handlers)
public com.lmax.disruptor.dsl.Disruptor getDisruptor(String topic)
public com.lmax.disruptor.dsl.Disruptor getDisruptorSingle(String topic)
public void releaseDisruptor(Object owner)
public com.lmax.disruptor.dsl.Disruptor createDisruptor(String topic)
topic -
public com.lmax.disruptor.dsl.Disruptor createSingleDisruptor(String topic)
topic -
public boolean isContain(String topic)
protected Collection loadEvenHandler(String topic)
topic -
protected Collection loadOnEventConsumers(String topic)
public TreeSet<DomainEventHandler> getTreeSet()
public void start()
Startable 复制的描述
Startable 中的 startpublic void stop()
Startable 复制的描述
Startable 中的 stop
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||