All Known Implementing Classes:
BatchedPreprocessor, BatchedRouterPreprocessor, TrivialPreprocessor
Enclosing class:
TunnelGateway

public static interface TunnelGateway.QueuePreprocessor
Interface for preprocessing queued tunnel messages. Handles message coalescing, fragmentation, and preparation for sending.
  • Method Details

    • preprocessQueue

      boolean preprocessQueue(List<PendingGatewayMessage> pending, TunnelGateway.Sender sender, TunnelGateway.Receiver receiver)
      Caller must synchronize on the list!
      Parameters:
      pending - list of Pending objects for messages either unsent or partly sent. This list should be update with any values removed (the preprocessor owns the lock) Messages are not removed from the list until actually sent. The status of unsent and partially-sent messages is stored in the Pending structure.
      sender - the sender to hand the encrypted data to
      receiver - the receiver to accept encrypted data
      Returns:
      true if we should delay before preprocessing again
    • getDelayAmount

      long getDelayAmount()
      How long do we want to wait before flushing.
      Returns:
      delay in milliseconds