Class DomainEventSetting
java.lang.Object
com.iohao.net.extension.domain.DomainEventSetting
DomainEventContextParam
- Author:
- 渔民小镇
- date:
- 2021-12-26
-
Field Summary
FieldsModifier and TypeFieldDescriptionCreate disruptorcom.lmax.disruptor.ExceptionHandler<Object> Exception handlingcom.lmax.disruptor.dsl.ProducerTypeintcom.lmax.disruptor.WaitStrategyWait strategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventHandler(DomainEventHandler<?> domainEventHandler) Add domain event handler, topic defaults to the T type of the interface implementation
-
Field Details
-
waitStrategy
public com.lmax.disruptor.WaitStrategy waitStrategyWait strategy
Strategy Applicable Scenario Name Locking Scenario where CPU resources are scarce, and throughput and latency are not critical BlockingWaitStrategySpinning Reduces latency by continuously retrying, minimizing system calls caused by thread switching. Recommended for scenarios where threads are bound to a fixed CPU BusySpinWaitStrategySpinning + yield + custom strategy Scenario where CPU resources are scarce, and throughput and latency are not critical PhasedBackoffWaitStrategySpinning + yield + sleep A good trade-off between performance and CPU resources. Latency is non-uniform SleepingWaitStrategyLocking, with timeout limit Scenario where CPU resources are scarce, and throughput and latency are not critical TimeoutBlockingWaitStrategySpinning + yield + spinning A good trade-off between performance and CPU resources. Latency is relatively uniform YieldingWaitStrategy -
producerType
public com.lmax.disruptor.dsl.ProducerType producerType -
ringBufferSize
public int ringBufferSize -
exceptionHandler
Exception handling -
disruptorCreator
Create disruptor -
commonEventProducer
-
-
Constructor Details
-
DomainEventSetting
public DomainEventSetting()
-
-
Method Details
-
addEventHandler
Add domain event handler, topic defaults to the T type of the interface implementation- Parameters:
domainEventHandler- domain event handler
-