Package io.grpc.internal
Class BackoffPolicyRetryScheduler
java.lang.Object
io.grpc.internal.BackoffPolicyRetryScheduler
- All Implemented Interfaces:
RetryScheduler
Schedules a retry operation according to a
BackoffPolicy
. The retry is run within a
SynchronizationContext
. At most one retry is scheduled at a time.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Logger
private BackoffPolicy
private final BackoffPolicy.Provider
private final ScheduledExecutorService
private final SynchronizationContext
-
Constructor Summary
ConstructorsConstructorDescriptionBackoffPolicyRetryScheduler
(BackoffPolicy.Provider policyProvider, ScheduledExecutorService scheduledExecutorService, SynchronizationContext syncContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
reset()
Resets theBackoffPolicyRetryScheduler
and cancels any pending retry task.void
Schedules a future retry operation.
-
Field Details
-
scheduledExecutorService
-
syncContext
-
policyProvider
-
policy
-
scheduledHandle
-
logger
-
-
Constructor Details
-
BackoffPolicyRetryScheduler
BackoffPolicyRetryScheduler(BackoffPolicy.Provider policyProvider, ScheduledExecutorService scheduledExecutorService, SynchronizationContext syncContext)
-
-
Method Details
-
schedule
Schedules a future retry operation. Only allows one retry to be scheduled at any given time.- Specified by:
schedule
in interfaceRetryScheduler
-
reset
public void reset()Resets theBackoffPolicyRetryScheduler
and cancels any pending retry task. The policy will be cleared thus also resetting any state associated with it (e.g. a backoff multiplier).- Specified by:
reset
in interfaceRetryScheduler
-