Package io.aeron.driver
Interface Subscribable
- All Known Implementing Classes:
IpcPublication
,NetworkPublication
,PublicationImage
public interface Subscribable
Stream source that can be observed by subscribers which identify themselves the position they have read up to.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubscriber
(SubscriptionLink subscriptionLink, ReadablePosition subscriberPosition, long nowNs) Add a subscriber and its position used for tracking consumption.void
removeSubscriber
(SubscriptionLink subscriptionLink, ReadablePosition subscriberPosition) Remove a subscriber and its position used for tracking consumption.long
Registration ID that is in use by the subscribable.
-
Method Details
-
subscribableRegistrationId
long subscribableRegistrationId()Registration ID that is in use by the subscribable.- Returns:
- registration ID for subscribable.
-
addSubscriber
void addSubscriber(SubscriptionLink subscriptionLink, ReadablePosition subscriberPosition, long nowNs) Add a subscriber and its position used for tracking consumption.- Parameters:
subscriptionLink
- for identifying the subscriber.subscriberPosition
- for tracking the subscriber.nowNs
- for the current time.
-
removeSubscriber
Remove a subscriber and its position used for tracking consumption.Note: The
Subscribable
is responsible for callingReadablePosition.close()
on removed positions.- Parameters:
subscriptionLink
- for identifying the subscriber.subscriberPosition
- for tracking the subscriber.
-