Interface RateControlledEntity

All Known Implementing Classes:
MultiPeerDownloader2, MultiPeerUploader, SinglePeerDownloader, SinglePeerUploader

public interface RateControlledEntity
Interface designation for rate-limited entities controlled by a handler.
  • Field Details

    • PRIORITY_NORMAL

      static final int PRIORITY_NORMAL
      Uses fair round-robin scheduling of processing ops.
      See Also:
    • PRIORITY_HIGH

      static final int PRIORITY_HIGH
      Guaranteed scheduling of processing ops, with preference over normal-priority entities.
      See Also:
  • Method Details

    • canProcess

      boolean canProcess(EventWaiter waiter)
      Is ready for a processing op.
      Returns:
      true if it can process >0 bytes, false if not ready
    • doProcessing

      int doProcessing(EventWaiter waiter, int max_bytes_permitted)
      Attempt to do a processing operation.
      Returns:
      true if >0 bytes were processed (success), false if 0 bytes were processed (failure)
    • getPriority

      int getPriority()
      Get this entity's priority level.
      Returns:
      priority
    • getPriorityBoost

      boolean getPriorityBoost()
      stats functions
      Returns:
    • getBytesReadyToWrite

      long getBytesReadyToWrite()
    • getConnectionCount

      int getConnectionCount(EventWaiter waiter)
      If there are no connections then the waiter will be kicked when a connection arrives
      Parameters:
      waiter -
      Returns:
    • getReadyConnectionCount

      int getReadyConnectionCount(EventWaiter waiter)
      The waiter is kicked if the ready condition changes
      Parameters:
      waiter -
      Returns:
    • getRateHandler

      RateHandler getRateHandler()
    • getString

      String getString()