class TimedWeightedPriorityMessageQueue extends Object implements MessageQueue, OutboundMessageFragments.ActiveThrottle
| Modifier and Type | Class and Description |
|---|---|
static interface |
TimedWeightedPriorityMessageQueue.FailedListener |
| Constructor and Description |
|---|
TimedWeightedPriorityMessageQueue(RouterContext ctx,
int[] priorityLimits,
int[] weighting,
TimedWeightedPriorityMessageQueue.FailedListener lsnr)
Build up a new queue
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(OutNetMessage message)
Add on a new message to the queue
|
void |
choke(net.i2p.data.Hash peer) |
OutNetMessage |
getNext(long blockUntil)
Grab the next message out of the next queue.
|
boolean |
isChoked(net.i2p.data.Hash peer) |
void |
shutdown() |
void |
unchoke(net.i2p.data.Hash peer) |
public TimedWeightedPriorityMessageQueue(RouterContext ctx, int[] priorityLimits, int[] weighting, TimedWeightedPriorityMessageQueue.FailedListener lsnr)
priorityLimits - ordered breakpoint for the different message
priorities, with the lowest limit first.weighting - how much to prefer a given priority grouping.
specifically, this means how many messages in this queue
should be pulled off in a row before moving on to the next.public void add(OutNetMessage message)
MessageQueueadd in interface MessageQueuepublic OutNetMessage getNext(long blockUntil)
getNext in interface MessageQueueblockUntil - expiration, or -1 if indefinitepublic void shutdown()
public void choke(net.i2p.data.Hash peer)
choke in interface OutboundMessageFragments.ActiveThrottlepublic void unchoke(net.i2p.data.Hash peer)
unchoke in interface OutboundMessageFragments.ActiveThrottlepublic boolean isChoked(net.i2p.data.Hash peer)
isChoked in interface OutboundMessageFragments.ActiveThrottle