Class DomainEventSetting

java.lang.Object
com.iohao.net.extension.domain.DomainEventSetting

public class DomainEventSetting extends Object
DomainEventContextParam
Author:
渔民小镇
date:
2021-12-26
  • Field Details

    • waitStrategy

      public com.lmax.disruptor.WaitStrategy waitStrategy

      Wait strategy

      Strategy Applicable Scenario Name
      Locking Scenario where CPU resources are scarce, and throughput and latency are not critical BlockingWaitStrategy
      Spinning Reduces latency by continuously retrying, minimizing system calls caused by thread switching. Recommended for scenarios where threads are bound to a fixed CPU BusySpinWaitStrategy
      Spinning + yield + custom strategy Scenario where CPU resources are scarce, and throughput and latency are not critical PhasedBackoffWaitStrategy
      Spinning + yield + sleep A good trade-off between performance and CPU resources. Latency is non-uniform SleepingWaitStrategy
      Locking, with timeout limit Scenario where CPU resources are scarce, and throughput and latency are not critical TimeoutBlockingWaitStrategy
      Spinning + 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

      public com.lmax.disruptor.ExceptionHandler<Object> exceptionHandler
      Exception handling
    • disruptorCreator

      public DisruptorCreator disruptorCreator
      Create disruptor
    • commonEventProducer

      public CommonEventProducer commonEventProducer
  • Constructor Details

    • DomainEventSetting

      public DomainEventSetting()
  • Method Details

    • addEventHandler

      public void addEventHandler(DomainEventHandler<?> domainEventHandler)
      Add domain event handler, topic defaults to the T type of the interface implementation
      Parameters:
      domainEventHandler - domain event handler