Package org.jitsi.utils.queue
Interface PacketQueue.PacketHandler
-
- All Implemented Interfaces:
public interface PacketQueue.PacketHandler<T>A simple interface to handle packets.
-
-
Method Summary
Modifier and Type Method Description abstract booleanhandlePacket(T pkt)Does something with a packet. longmaxSequentiallyProcessedPackets()Specifies the number of packets allowed to be processed sequentially without yielding control to executor's thread. -
-
Method Detail
-
handlePacket
abstract boolean handlePacket(T pkt)
Does something with a packet.
- Parameters:
pkt- the packet to do something with.- Returns:
trueif the operation was successful, andfalseotherwise.
-
maxSequentiallyProcessedPackets
long maxSequentiallyProcessedPackets()
Specifies the number of packets allowed to be processed sequentially without yielding control to executor's thread. Specifying positive number will allow other possible queues sharing same ExecutorService to process their packets.
- Returns:
positive value to specify max number of packets which allows implementation of cooperative multi-tasking between different PacketQueue sharing same ExecutorService.
-
-
-
-