public class RateThrottlingPolicy extends StaticThrottlePolicy
Constructor and Description |
---|
RateThrottlingPolicy(double desiredRate) |
RateThrottlingPolicy(double desiredRate,
com.yahoo.concurrent.Timer timer) |
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.
|
getMaxPendingCount, getMaxPendingSize, getPendingSize, processMessage, processReply, setMaxPendingCount, setMaxPendingSize
public static final Logger log
public RateThrottlingPolicy(double desiredRate)
public RateThrottlingPolicy(double desiredRate, com.yahoo.concurrent.Timer timer)
public boolean canSend(Message msg, int pendingCount)
ThrottlePolicy
canSend
in interface ThrottlePolicy
canSend
in class StaticThrottlePolicy
msg
- The message to evaluate.pendingCount
- The current number of pending messages.Copyright © 2018. All rights reserved.