Class RecordingSignalAdapter

java.lang.Object
io.aeron.archive.client.RecordingSignalAdapter

public final class RecordingSignalAdapter extends Object
Encapsulate the polling, decoding, and dispatching of recording transition events for a session plus the asynchronous events to check for errors.

Important: set the underlying RecordingSignalConsumer instance on the AeronArchive using the AeronArchive.Context.recordingSignalConsumer(RecordingSignalConsumer) method to avoid missing signals.

See Also:
  • RecordingSignal
  • Constructor Details

    • RecordingSignalAdapter

      public RecordingSignalAdapter(long controlSessionId, ControlEventListener controlEventListener, RecordingSignalConsumer recordingSignalConsumer, Subscription subscription, int fragmentLimit)
      Create an adapter for a given subscription to an archive for recording events.
      Parameters:
      controlSessionId - to listen for associated asynchronous control events, such as errors.
      controlEventListener - listener for control events which may indicate an error on the session.
      recordingSignalConsumer - consumer of recording transition events.
      subscription - to poll for new events.
      fragmentLimit - to apply for each polling operation.
  • Method Details

    • poll

      public int poll()
      Poll for recording transitions and dispatch them to the RecordingSignalConsumer for this instance, plus check for async responses for this control session which may have an exception and dispatch to the ControlResponseListener.
      Returns:
      the number of fragments read during the operation. Zero if no events are available.
    • isDone

      public boolean isDone()
      Indicate that poll was successful and a signal or control response was received.
      Returns:
      true if a signal or control response was received.