Class CounterSnapshotSubscriber

  • All Implemented Interfaces:
    io.aeron.logbuffer.FragmentHandler, java.lang.AutoCloseable

    public final class CounterSnapshotSubscriber
    extends java.lang.Object
    implements io.aeron.logbuffer.FragmentHandler, java.lang.AutoCloseable
    A listener to data published by a CounterSnapshotPublisher.
    • Constructor Detail

      • CounterSnapshotSubscriber

        public CounterSnapshotSubscriber()
        Creates a new subscriber using runtime configuration.
      • CounterSnapshotSubscriber

        public CounterSnapshotSubscriber​(CounterSnapshotSubscriber.Context context)
        Creates a new subscriber from the supplied context.
        Parameters:
        context - configuration context
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception
      • onFragment

        public void onFragment​(org.agrona.DirectBuffer buffer,
                               int offset,
                               int length,
                               io.aeron.logbuffer.Header header)
        Specified by:
        onFragment in interface io.aeron.logbuffer.FragmentHandler
      • doWork

        public int doWork()
        Poll the Aeron Subscription.
        Returns:
        number of fragments processed