Add some size methods.
Dieser Commit ist enthalten in:
Ursprung
e4e4581717
Commit
48cedd20d4
@ -69,7 +69,7 @@ class PacketProcessingQueue extends AbstractConcurrentListenerMultimap<AsyncList
|
|||||||
public boolean enqueue(PacketEvent packet, boolean onMainThread) {
|
public boolean enqueue(PacketEvent packet, boolean onMainThread) {
|
||||||
try {
|
try {
|
||||||
processingQueue.add(new PacketEventHolder(packet));
|
processingQueue.add(new PacketEventHolder(packet));
|
||||||
|
|
||||||
// Begin processing packets
|
// Begin processing packets
|
||||||
signalBeginProcessing(onMainThread);
|
signalBeginProcessing(onMainThread);
|
||||||
return true;
|
return true;
|
||||||
@ -78,6 +78,14 @@ class PacketProcessingQueue extends AbstractConcurrentListenerMultimap<AsyncList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of packet events in the queue.
|
||||||
|
* @return The number of packet events in the queue.
|
||||||
|
*/
|
||||||
|
public int size() {
|
||||||
|
return processingQueue.size();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the current method and each thread to signal that a packet might be ready for processing.
|
* Called by the current method and each thread to signal that a packet might be ready for processing.
|
||||||
* @param onMainThread - whether or not this is occuring on the main thread.
|
* @param onMainThread - whether or not this is occuring on the main thread.
|
||||||
|
@ -22,6 +22,14 @@ class PacketSendingQueue {
|
|||||||
// Whether or not packet transmission can only occur on the main thread
|
// Whether or not packet transmission can only occur on the main thread
|
||||||
private final boolean synchronizeMain;
|
private final boolean synchronizeMain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of packet events in the queue.
|
||||||
|
* @return The number of packet events in the queue.
|
||||||
|
*/
|
||||||
|
public int size() {
|
||||||
|
return sendingQueue.size();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a packet sending queue.
|
* Create a packet sending queue.
|
||||||
* @param synchronizeMain - whether or not to synchronize with the main thread.
|
* @param synchronizeMain - whether or not to synchronize with the main thread.
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren