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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final long
private long
private ScheduledExecutorService
private boolean
private ScheduledFuture
<?> private Runnable
private static final MaxConnectionIdleManager.Ticker
private final MaxConnectionIdleManager.Ticker
-
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.
-
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.
-