Package io.grpc
Class SynchronizationContext.ScheduledHandle
- java.lang.Object
-
- io.grpc.SynchronizationContext.ScheduledHandle
-
- Enclosing class:
- SynchronizationContext
public static final class SynchronizationContext.ScheduledHandle extends java.lang.Object
Allows the user to check the status and/or cancel a task scheduled bySynchronizationContext.schedule(java.lang.Runnable, long, java.util.concurrent.TimeUnit, java.util.concurrent.ScheduledExecutorService)
.This class is NOT thread-safe. All methods must be run from the same
SynchronizationContext
as which the task was scheduled in.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ScheduledFuture<?>
future
private SynchronizationContext.ManagedRunnable
runnable
-
Constructor Summary
Constructors Modifier Constructor Description private
ScheduledHandle(SynchronizationContext.ManagedRunnable runnable, java.util.concurrent.ScheduledFuture<?> future)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancel the task if it's stillpending
.boolean
isPending()
Returnstrue
if the task will eventually run, meaning that it has neither started running nor been cancelled.
-
-
-
Field Detail
-
runnable
private final SynchronizationContext.ManagedRunnable runnable
-
future
private final java.util.concurrent.ScheduledFuture<?> future
-
-
Constructor Detail
-
ScheduledHandle
private ScheduledHandle(SynchronizationContext.ManagedRunnable runnable, java.util.concurrent.ScheduledFuture<?> future)
-
-
Method Detail
-
cancel
public void cancel()
Cancel the task if it's stillpending
.
-
isPending
public boolean isPending()
Returnstrue
if the task will eventually run, meaning that it has neither started running nor been cancelled.
-
-