public abstract class MaxInFlightRequestStrategy extends java.lang.Object implements RequestStrategy
max
and also takes the number of messages
that have been queued internally or delegated to other actors into account.
Concrete subclass must implement inFlightInternally()
.
It will request elements in minimum batches of the defined batchSize()
.Constructor and Description |
---|
MaxInFlightRequestStrategy(int max) |
Modifier and Type | Method and Description |
---|---|
int |
batchSize()
Elements will be requested in minimum batches of this size.
|
abstract int |
inFlightInternally()
Concrete subclass must implement this method to define how many
messages that are currently in progress or queued.
|
int |
requestDemand(int remainingRequested)
Invoked by the
ActorSubscriber after each incoming message to
determine how many more elements to request from the stream. |
public abstract int inFlightInternally()
public int batchSize()
public int requestDemand(int remainingRequested)
RequestStrategy
ActorSubscriber
after each incoming message to
determine how many more elements to request from the stream.
requestDemand
in interface RequestStrategy
remainingRequested
- current remaining number of elements that
have been requested from upstream but not received yet