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 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

      void removeSubscriber(SubscriptionLink subscriptionLink, ReadablePosition subscriberPosition)
      Remove a subscriber and its position used for tracking consumption.

      Note: The Subscribable is responsible for calling ReadablePosition.close() on removed positions.

      Parameters:
      subscriptionLink - for identifying the subscriber.
      subscriberPosition - for tracking the subscriber.