src/main/java/io/reactivex/disposables/Disposables.java
@NonNull
    public static Disposable fromFuture(@NonNull Future<?> future, boolean allowInterrupt) {
        ObjectHelper.requireNonNull(future, "future is null");
        return new FutureDisposable(future, allowInterrupt);
    }
@NonNull
    public static Disposable fromFuture(@NonNull Future<?> future, boolean allowInterrupt) {
        ObjectHelper.requireNonNull(future, "future is null");
        return new FutureDisposable(future, allowInterrupt);
    }
@ NonNull public static Disposable fromFuture ( @ NonNull Future < ? > future , boolean allowInterrupt ) { ObjectHelper . requireNonNull ( future , "future is null" ) ; return new FutureDisposable ( future , allowInterrupt ) ; }
Construct a Disposable by wrapping a Future that is
cancelled exactly once when the Disposable is disposed.
@param future the Future to wrap
@param allowInterrupt if true, the future cancel happens via Future.cancel(true)
@return the new Disposable instance
Construct a Disposable by wrapping a Future that is cancelled exactly once when the Disposable is disposed .