Class MaxConnectionIdleManager

java.lang.Object
io.grpc.internal.MaxConnectionIdleManager

public final class MaxConnectionIdleManager extends Object
Monitors connection idle time; shutdowns the connection if the max connection idle is reached.
  • Constructor Details

    • MaxConnectionIdleManager

      public MaxConnectionIdleManager(long maxConnectionIdleInNanos)
    • MaxConnectionIdleManager

      public MaxConnectionIdleManager(long maxConnectionIdleInNanos, MaxConnectionIdleManager.Ticker ticker)
  • Method Details

    • start

      public void start(Runnable closeJob, ScheduledExecutorService scheduler)
      Start the initial scheduled shutdown given the transport status reaches max connection idle.
      Parameters:
      closeJob - Closes the connection by sending GO_AWAY with status code NO_ERROR and ASCII debug data max_idle and then doing the graceful connection termination.
    • onTransportActive

      public void onTransportActive()
      There are outstanding RPCs on the transport.
    • onTransportIdle

      public void onTransportIdle()
      There are no outstanding RPCs on the transport.
    • onTransportTermination

      public void onTransportTermination()
      Transport is being terminated.