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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PublisherHandler.SegmentResult
-
Constructor Summary
Constructors Constructor Description PublisherHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closePublisher(String requestId)
Closes the publisher that maps to the given request idCompletableFuture<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)
.int
openPublishers()
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)
-
-
-
Method Detail
-
viewChange
public void viewChange(ViewChangedEvent event)
-
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
public void closePublisher(String requestId)
Closes the publisher that maps to the given request id- Parameters:
requestId
- unique identifier for the request
-
-