Package io.grpc.internal
Class MaxConnectionIdleManager
java.lang.Object
io.grpc.internal.MaxConnectionIdleManager
Monitors connection idle time; shutdowns the connection if the max connection idle is reached.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMaxConnectionIdleManager
(long maxConnectionIdleInNanos) MaxConnectionIdleManager
(long maxConnectionIdleInNanos, MaxConnectionIdleManager.Ticker ticker) -
Method Summary
Modifier and TypeMethodDescriptionvoid
There are outstanding RPCs on the transport.void
There are no outstanding RPCs on the transport.void
Transport is being terminated.void
start
(Runnable closeJob, ScheduledExecutorService scheduler) Start the initial scheduled shutdown given the transport status reaches max connection idle.
-
Constructor Details
-
MaxConnectionIdleManager
public MaxConnectionIdleManager(long maxConnectionIdleInNanos) -
MaxConnectionIdleManager
public MaxConnectionIdleManager(long maxConnectionIdleInNanos, MaxConnectionIdleManager.Ticker ticker)
-
-
Method Details
-
start
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.
-