Class RetriableStream.FutureCanceller

  • Enclosing class:
    RetriableStream<ReqT>

    private static final class RetriableStream.FutureCanceller
    extends java.lang.Object
    Allows cancelling a Future without racing with setting the future.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean cancelled  
      (package private) java.util.concurrent.Future<?> future  
      (package private) java.lang.Object lock  
    • Constructor Summary

      Constructors 
      Constructor Description
      FutureCanceller​(java.lang.Object lock)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean isCancelled()  
      (package private) java.util.concurrent.Future<?> markCancelled()  
      (package private) void setFuture​(java.util.concurrent.Future<?> future)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • lock

        final java.lang.Object lock
      • future

        java.util.concurrent.Future<?> future
      • cancelled

        boolean cancelled
    • Constructor Detail

      • FutureCanceller

        FutureCanceller​(java.lang.Object lock)
    • Method Detail

      • setFuture

        void setFuture​(java.util.concurrent.Future<?> future)
      • markCancelled

        @CheckForNull
        java.util.concurrent.Future<?> markCancelled()
      • isCancelled

        boolean isCancelled()