Class PublisherHandler
- java.lang.Object
-
- org.infinispan.reactive.publisher.impl.PublisherHandler
-
public class PublisherHandler extends Object
Handler for holding publisher results between requests of data- Since:
- 10.1
-
-
Constructor Summary
Constructors Constructor Description PublisherHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclosePublisher(String requestId)Closes the publisher that maps to the given request idCompletableFuture<PublisherResponse>getNext(String requestId)Retrieves the next response for the same request id that was configured on the command when invokingregister(InitialPublisherCommand).intopenPublishers()Returns how many publishers are currently open<I,R>
CompletableFuture<PublisherResponse>register(InitialPublisherCommand<?,I,R> command)Registers a publisher given the initial command arguments.voidstart()voidstop()voidviewChange(ViewChangedEvent event)
-
-
-
Method Detail
-
viewChange
public void viewChange(ViewChangedEvent event)
-
start
public void start()
-
stop
public void stop()
-
register
public <I,R> CompletableFuture<PublisherResponse> register(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 typeR- 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<PublisherResponse> getNext(String requestId)
Retrieves the next response for the same request id that was configured on the command when invokingregister(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
-
-