|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
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 Map<String,TreeSet<DomainEventHandler>> |
handlesMap
|
static String |
module
|
| 构造方法摘要 | |
|---|---|
DisruptorFactory()
|
|
DisruptorFactory(DisruptorParams disruptorParams,
ContainerCallback containerCallback)
|
|
| 方法摘要 | |
|---|---|
com.lmax.disruptor.dsl.Disruptor |
addEventMessageHandler(String topic,
TreeSet<DomainEventHandler> handlers)
|
com.lmax.disruptor.dsl.Disruptor |
createDisruptor(String topic)
one event one EventDisruptor |
TreeSet<DomainEventHandler> |
getTreeSet()
|
protected TreeSet<DomainEventHandler> |
loadEvenHandler(String topic)
if there are many consumers, execution order will be alphabetical list by Name of @Consumer class. |
protected TreeSet<DomainEventHandler> |
loadOnEventConsumers(String topic,
TreeSet<DomainEventHandler> ehs)
|
EventDisruptor |
newInstance()
|
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 Map<String,TreeSet<DomainEventHandler>> handlesMap
| 构造方法详细信息 |
|---|
public DisruptorFactory(DisruptorParams disruptorParams,
ContainerCallback containerCallback)
public DisruptorFactory()
| 方法详细信息 |
|---|
public com.lmax.disruptor.dsl.Disruptor addEventMessageHandler(String topic,
TreeSet<DomainEventHandler> handlers)
public com.lmax.disruptor.dsl.Disruptor createDisruptor(String topic)
topic -
protected TreeSet<DomainEventHandler> loadEvenHandler(String topic)
topic -
protected TreeSet<DomainEventHandler> loadOnEventConsumers(String topic,
TreeSet<DomainEventHandler> ehs)
public TreeSet<DomainEventHandler> getTreeSet()
public EventDisruptor newInstance()
com.lmax.disruptor.EventFactory 中的 newInstancepublic void start()
Startable 复制的描述
Startable 中的 startpublic void stop()
Startable 复制的描述
Startable 中的 stop
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||