Package io.aeron.archive.client
Class RecordingSubscriptionDescriptorPoller
java.lang.Object
io.aeron.archive.client.RecordingSubscriptionDescriptorPoller
Encapsulate the polling, decoding, dispatching of recording descriptors from an archive.
-
Constructor Summary
ConstructorsConstructorDescriptionRecordingSubscriptionDescriptorPoller(Subscription subscription, ErrorHandler errorHandler, long controlSessionId, int fragmentLimit) Create a poller for a given subscription to an archive for control response messages.RecordingSubscriptionDescriptorPoller(Subscription subscription, ErrorHandler errorHandler, RecordingSignalConsumer recordingSignalConsumer, long controlSessionId, int fragmentLimit) Create a poller for a given subscription to an archive for control response messages. -
Method Summary
Modifier and TypeMethodDescriptionlongControl session id for filtering responses.booleanIs the dispatch of descriptors complete?intpoll()Poll for recording subscriptions and delegate to theRecordingSubscriptionDescriptorConsumer.intGet the number of remaining subscriptions expected.voidreset(long correlationId, int subscriptionCount, RecordingSubscriptionDescriptorConsumer consumer) Reset the poller to dispatch the descriptors returned from a query.Get theSubscriptionused for polling responses.
-
Constructor Details
-
RecordingSubscriptionDescriptorPoller
public RecordingSubscriptionDescriptorPoller(Subscription subscription, ErrorHandler errorHandler, long controlSessionId, int fragmentLimit) Create a poller for a given subscription to an archive for control response messages.- Parameters:
subscription- to poll for new events.errorHandler- to call for asynchronous errors.controlSessionId- to filter the responses.fragmentLimit- to apply for each polling operation.
-
RecordingSubscriptionDescriptorPoller
public RecordingSubscriptionDescriptorPoller(Subscription subscription, ErrorHandler errorHandler, RecordingSignalConsumer recordingSignalConsumer, long controlSessionId, int fragmentLimit) Create a poller for a given subscription to an archive for control response messages.- Parameters:
subscription- to poll for new events.errorHandler- to call for asynchronous errors.recordingSignalConsumer- for consuming interleaved recording signals on the control session.controlSessionId- to filter the responses.fragmentLimit- to apply for each polling operation.
-
-
Method Details
-
subscription
Get theSubscriptionused for polling responses.- Returns:
- the
Subscriptionused for polling responses.
-
poll
public int poll()Poll for recording subscriptions and delegate to theRecordingSubscriptionDescriptorConsumer.- Returns:
- the number of fragments read during the operation. Zero if no events are available.
-
controlSessionId
public long controlSessionId()Control session id for filtering responses.- Returns:
- control session id for filtering responses.
-
isDispatchComplete
public boolean isDispatchComplete()Is the dispatch of descriptors complete?- Returns:
- true if the dispatch of descriptors complete?
-
remainingSubscriptionCount
public int remainingSubscriptionCount()Get the number of remaining subscriptions expected.- Returns:
- the number of remaining subscriptions expected.
-
reset
public void reset(long correlationId, int subscriptionCount, RecordingSubscriptionDescriptorConsumer consumer) Reset the poller to dispatch the descriptors returned from a query.- Parameters:
correlationId- for the response.subscriptionCount- of descriptors to expect.consumer- to which the recording subscription descriptors are to be dispatched.
-