Package io.aeron.archive.client
Class ControlResponseAdapter
java.lang.Object
io.aeron.archive.client.ControlResponseAdapter
Encapsulate the polling, decoding, and dispatching of archive control protocol response messages.
-
Constructor Summary
ConstructorsConstructorDescriptionControlResponseAdapter(ControlResponseListener controlResponseListener, RecordingSignalConsumer recordingSignalConsumer, Subscription subscription, int fragmentLimit) Create an adapter for a given subscription to an archive for control response messages.ControlResponseAdapter(ControlResponseListener controlResponseListener, Subscription subscription, int fragmentLimit) Create an adapter for a given subscription to an archive for control response messages. -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddispatchDescriptor(io.aeron.archive.codecs.RecordingDescriptorDecoder decoder, RecordingDescriptorConsumer consumer) Dispatch a descriptor message to a consumer by reading the fields in the correct order.intpoll()Poll for recording events and dispatch them to theControlResponseListenerfor this instance.
-
Constructor Details
-
ControlResponseAdapter
public ControlResponseAdapter(ControlResponseListener controlResponseListener, Subscription subscription, int fragmentLimit) Create an adapter for a given subscription to an archive for control response messages.- Parameters:
controlResponseListener- for dispatching responses.subscription- to poll for responses.fragmentLimit- to apply for each polling operation.
-
ControlResponseAdapter
public ControlResponseAdapter(ControlResponseListener controlResponseListener, RecordingSignalConsumer recordingSignalConsumer, Subscription subscription, int fragmentLimit) Create an adapter for a given subscription to an archive for control response messages.- Parameters:
controlResponseListener- for dispatching responses.recordingSignalConsumer- for dispatching recording signals.subscription- to poll for responses.fragmentLimit- to apply for each polling operation.
-
-
Method Details
-
poll
public int poll()Poll for recording events and dispatch them to theControlResponseListenerfor this instance.- Returns:
- the number of fragments read during the operation. Zero if no events are available.
-
dispatchDescriptor
public static void dispatchDescriptor(io.aeron.archive.codecs.RecordingDescriptorDecoder decoder, RecordingDescriptorConsumer consumer) Dispatch a descriptor message to a consumer by reading the fields in the correct order.- Parameters:
decoder- which wraps the encoded message ready for reading.consumer- to which the decoded fields should be passed.
-