Class RingBufferLogEventHandler4

  • All Implemented Interfaces:
    com.lmax.disruptor.EventHandler<RingBufferLogEvent>
    Direct Known Subclasses:
    RingBufferLogEventHandler

    class RingBufferLogEventHandler4
    extends java.lang.Object
    implements com.lmax.disruptor.EventHandler<RingBufferLogEvent>
    This event handler gets passed messages from the RingBuffer as they become available. Processing of these messages is done in a separate thread, controlled by the Executor passed to the Disruptor constructor. *

    * Warning: this class only works with Disruptor 4.x. *

    • Field Detail

      • NOTIFY_PROGRESS_THRESHOLD

        private static final int NOTIFY_PROGRESS_THRESHOLD
        See Also:
        Constant Field Values
      • sequenceCallback

        private com.lmax.disruptor.Sequence sequenceCallback
      • counter

        private int counter
      • threadId

        private long threadId
    • Constructor Detail

      • RingBufferLogEventHandler4

        RingBufferLogEventHandler4()
    • Method Detail

      • setSequenceCallback

        public void setSequenceCallback​(com.lmax.disruptor.Sequence sequenceCallback)
      • onEvent

        public void onEvent​(RingBufferLogEvent event,
                            long sequence,
                            boolean endOfBatch)
                     throws java.lang.Exception
        Specified by:
        onEvent in interface com.lmax.disruptor.EventHandler<RingBufferLogEvent>
        Throws:
        java.lang.Exception
      • notifyCallback

        private void notifyCallback​(long sequence)
      • getThreadId

        public long getThreadId()
        Returns the thread ID of the background consumer thread, or -1 if the background thread has not started yet.
        Returns:
        the thread ID of the background consumer thread, or -1
      • onStart

        public void onStart()
      • onShutdown

        public void onShutdown()