Class PublisherHandler


  • public class PublisherHandler
    extends Object
    Handler for holding publisher results between requests of data
    Since:
    10.1
    • Constructor Detail

      • PublisherHandler

        public PublisherHandler()
    • Method Detail

      • start

        public void start()
      • stop

        public void stop()
      • register

        public <I,​R> CompletableFuture<org.infinispan.reactive.publisher.impl.commands.batch.PublisherResponse> register​(org.infinispan.reactive.publisher.impl.commands.batch.InitialPublisherCommand<?,​I,​R> command)
        Registers a publisher given the initial command arguments. The value returned will eventually contain the first batched response for the publisher of the given id.
        Type Parameters:
        I - input type
        R - output type
        Parameters:
        command - the command with arguments to start a publisher with
        Returns:
        future that will or eventually will contain the first response
      • getNext

        public CompletableFuture<org.infinispan.reactive.publisher.impl.commands.batch.PublisherResponse> getNext​(String requestId)
        Retrieves the next response for the same request id that was configured on the command when invoking register(InitialPublisherCommand).
        Parameters:
        requestId - the unique request id to continue the response with
        Returns:
        future that will or eventually will contain the next response
      • openPublishers

        public int openPublishers()
        Returns how many publishers are currently open
        Returns:
        how many publishers are currently open
      • closePublisher

        public void closePublisher​(String requestId)
        Closes the publisher that maps to the given request id
        Parameters:
        requestId - unique identifier for the request