Class BufferedCancelIndicator

  • All Implemented Interfaces:
    CancelIndicator

    public class BufferedCancelIndicator
    extends java.lang.Object
    implements CancelIndicator
    A cancel indicator that will not cancel immediately but only after a delay to allow short running tasks to complete despite an attempt to cancel.
    • Constructor Detail

      • BufferedCancelIndicator

        public BufferedCancelIndicator​(CancelIndicator delegate)
        Buffer the cancellation attempts that are issued by the given delegate.
      • BufferedCancelIndicator

        public BufferedCancelIndicator​(CancelIndicator delegate,
                                       com.google.common.base.Ticker clock,
                                       long delayInNanos)
        Buffer the cancellation attempts that are issued by the given delegate. Use the given clock as the source for the time. This is public for testing purpose.