Enclosing class:
TunnelGatewayPumper

private static class TunnelGatewayPumper.PoisonPTGextends PumpedTunnelGateway
Special poison pill PumpedTunnelGateway to signal thread shutdown.
  • Constructor Details

    • PoisonPTG

      public PoisonPTG(RouterContext ctx)
      Builds the gateway that stops a pump thread.
      Parameters:
      ctx - the router context
  • Method Details

    • getMessagesSent

      public int getMessagesSent()
      Description copied from class: TunnelGateway
      The number of messages sent.
      Overrides:
      getMessagesSent in class TunnelGateway
      Returns:
      the number of messages sent
    • pump

      public boolean pump(List<PendingGatewayMessage> queueBuf)
      Description copied from class: PumpedTunnelGateway
      Pumps messages from the internal prequeue into the processing queue.

      This method tries to drain a bounded number of messages from _prequeue into the provided queueBuf, then adds them to the internal _queue for preprocessing and fragmentation.

      Expired messages are removed after preprocessing, outside the synchronization block, to reduce contention.

      Overrides:
      pump in class PumpedTunnelGateway
      Parameters:
      queueBuf - an empty list used as a temporary buffer for messages (will be cleared before return)
      Returns:
      true if there are still messages remaining in _prequeue and the caller should requeue this gateway