Class PublisherHandler
java.lang.Object
org.infinispan.reactive.publisher.impl.PublisherHandler
Handler for holding publisher results between requests of data
- Since:
- 10.1
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
closePublisher
(String requestId) Closes the publisher that maps to the given request idCompletableFuture
<org.infinispan.reactive.publisher.impl.commands.batch.PublisherResponse> Retrieves the next response for the same request id that was configured on the command when invokingregister(InitialPublisherCommand)
.int
Returns how many publishers are currently open<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.void
start()
void
stop()
void
viewChange
(ViewChangedEvent event)
-
Constructor Details
-
PublisherHandler
public PublisherHandler()
-
-
Method Details
-
viewChange
-
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 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<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 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
Closes the publisher that maps to the given request id- Parameters:
requestId
- unique identifier for the request
-