MessageQueue, OutboundMessageFragments.ActiveThrottleclass TimedWeightedPriorityMessageQueue extends Object implements MessageQueue, OutboundMessageFragments.ActiveThrottle
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
TimedWeightedPriorityMessageQueue.FailedListener |
| Constructor | Description |
|---|---|
TimedWeightedPriorityMessageQueue(RouterContext ctx,
int[] priorityLimits,
int[] weighting,
TimedWeightedPriorityMessageQueue.FailedListener lsnr) |
Build up a new queue
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(OutNetMessage message) |
Add on a new message to the queue
|
void |
choke(Hash peer) |
|
OutNetMessage |
getNext(long blockUntil) |
Grab the next message out of the next queue.
|
boolean |
isChoked(Hash peer) |
|
void |
shutdown() |
|
void |
unchoke(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(Hash peer)
choke in interface OutboundMessageFragments.ActiveThrottlepublic void unchoke(Hash peer)
unchoke in interface OutboundMessageFragments.ActiveThrottlepublic boolean isChoked(Hash peer)
isChoked in interface OutboundMessageFragments.ActiveThrottle