public interface ThrottlePolicy
SourceSession
to throttle output. Every message entering
SourceSession.send(Message)
needs to be accepted by this interface's canSend(Message, int)
method.
All messages accepted are passed through the processMessage(Message)
method, and the corresponding replies
are passed through the processReply(Reply)
method.Modifier and Type | Method and Description |
---|---|
boolean |
canSend(Message msg,
int pendingCount)
Returns whether or not the given message can be sent according to the current state of this policy.
|
void |
processMessage(Message msg)
This method is called once for every message that was accepted by
canSend(Message, int) and sent. |
void |
processReply(Reply reply)
This method is called once for every reply that is received.
|
boolean canSend(Message msg, int pendingCount)
msg
- The message to evaluate.pendingCount
- The current number of pending messages.void processMessage(Message msg)
canSend(Message, int)
and sent.msg
- The message beint sent.void processReply(Reply reply)
reply
- The reply received.Copyright © 2018. All rights reserved.