Class TrackKeepingDiscoveryService

  • All Implemented Interfaces:
    DiscoveryService

    public class TrackKeepingDiscoveryService
    extends java.lang.Object
    implements DiscoveryService
    Special implementation of a DiscoveryService. It is able to discover streams recursively while preventing cycles. Also, it is able to detect recursive discoveries from multiple threads, which is not allowed.
    • Method Detail

      • discover

        public <T> org.reactivestreams.Publisher<T> discover​(StreamId<T> id)
        Description copied from interface: DiscoveryService
        Given a StreamId, this method returns the correspondent Publisher. This method should not return null, instead is preferred to throw a specific exception in the case the given id is not present in the system. From the API level, this behavior is not forced.
        Specified by:
        discover in interface DiscoveryService
        Parameters:
        id - the identifier of the stream to be discovered
        Returns:
        the discovered Publisher