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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final longprivate longprivate ScheduledExecutorServiceprivate booleanprivate ScheduledFuture<?> private Runnableprivate static final MaxConnectionIdleManager.Tickerprivate final MaxConnectionIdleManager.Ticker -
Constructor Summary
ConstructorsConstructorDescriptionMaxConnectionIdleManager(long maxConnectionIdleInNanos) MaxConnectionIdleManager(long maxConnectionIdleInNanos, MaxConnectionIdleManager.Ticker ticker) -
Method Summary
Modifier and TypeMethodDescriptionvoidThere are outstanding RPCs on the transport.voidThere are no outstanding RPCs on the transport.voidTransport is being terminated.voidstart(Runnable closeJob, ScheduledExecutorService scheduler) Start the initial scheduled shutdown given the transport status reaches max connection idle.
-
Field Details
-
systemTicker
-
maxConnectionIdleInNanos
private final long maxConnectionIdleInNanos -
ticker
-
shutdownFuture
-
shutdownTask
-
scheduler
-
nextIdleMonitorTime
private long nextIdleMonitorTime -
shutdownDelayed
private boolean shutdownDelayed -
isActive
private boolean isActive
-
-
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.
-