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 Loggerprivate BackoffPolicyprivate final BackoffPolicy.Providerprivate final ScheduledExecutorServiceprivate final SynchronizationContext -
Constructor Summary
ConstructorsConstructorDescriptionBackoffPolicyRetryScheduler(BackoffPolicy.Provider policyProvider, ScheduledExecutorService scheduledExecutorService, SynchronizationContext syncContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()Resets theBackoffPolicyRetrySchedulerand cancels any pending retry task.voidSchedules 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:
schedulein interfaceRetryScheduler
-
reset
public void reset()Resets theBackoffPolicyRetrySchedulerand 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:
resetin interfaceRetryScheduler
-