room/guava/src/main/java/androidx/room/guava/GuavaRoom.java
public static <T> ListenableFuture<T> createListenableFuture(
            final Callable<T> callable,
            final RoomSQLiteQuery query,
            final boolean releaseQuery) {
        ListenableFutureTask<T> listenableFutureTask = ListenableFutureTask.create(callable);
        ArchTaskExecutor.getInstance().executeOnDiskIO(listenableFutureTask);

        if (releaseQuery) {
            Futures.addCallback(
                    listenableFutureTask,
                    new FutureCallback<T>() {
                        @Override
                        public void onSuccess(T t) {
                            query.release();
                        }

                        @Override
                        public void onFailure(Throwable throwable) {
                            query.release();
                        }
                    },
                    directExecutor());
        }

        return listenableFutureTask;
    }
/**
     * Returns a {@link ListenableFuture<T>} created by submitting the input {@code callable} to
     * {@link ArchTaskExecutor}'s background-threaded Executor.
     */
Returns a  ListenableFuture created by submitting the input  callable to
ArchTaskExecutor's background-threaded Executor.
Returns a ListenableFuture created by submitting the input callable to ArchTaskExecutor ' s background - threaded Executor .
public static <T> ListenableFuture<T> createListenableFuture(
            final Callable<T> callable,
            final RoomSQLiteQuery query,
            final boolean releaseQuery) {
        ListenableFutureTask<T> listenableFutureTask = ListenableFutureTask.create(callable);
        ArchTaskExecutor.getInstance().executeOnDiskIO(listenableFutureTask);
        if (releaseQuery) {
            Futures.addCallback(
                    listenableFutureTask,
                    new FutureCallback<T>() {
                        @Override
                        public void onSuccess(T t) {
                            query.release();
                        }
                        @Override
                        public void onFailure(Throwable throwable) {
                            query.release();
                        }
                    },
                    directExecutor());
        }
        return listenableFutureTask;
    }
public static < T > ListenableFuture < T > createListenableFuture ( final Callable < T > callable , final RoomSQLiteQuery query , final boolean releaseQuery ) { ListenableFutureTask < T > listenableFutureTask = ListenableFutureTask . create ( callable ) ; ArchTaskExecutor . getInstance ( ) . executeOnDiskIO ( listenableFutureTask ) ; if ( releaseQuery ) { Futures . addCallback ( listenableFutureTask , new FutureCallback < T > ( ) { @ Override public void onSuccess ( T t ) { query . release ( ) ; } @ Override public void onFailure ( Throwable throwable ) { query . release ( ) ; } } , directExecutor ( ) ) ; } return listenableFutureTask ; }
Returns a {@link ListenableFuture<T>} created by submitting the input {@code callable} to
 {@link ArchTaskExecutor}'s background-threaded Executor.
Returns a { @link ListenableFuture<T > } created by submitting the input { @code callable } to { @link ArchTaskExecutor } ' s background - threaded Executor .