@Override
          public void onCancellation(DataSource<T> dataSource) {
            // will make the outer method return null
            latch.countDown();
          }
This methods blocks the calling thread until the {@link DataSource} has a final result, has
been cancelled or has failed.

@param dataSource The {@link DataSource} to wait for. The caller MUST close the data source
    after this method returned!
@param <T> The type parameter for the {@link DataSource}
@param timeout The maximum time to wait for the final result
@param unit The time unit of the timeout argument
@return The final result of the {@link DataSource}. Intermediate results are ignored. Might be
    <code>null</code> if the data source has been cancelled.
@throws Throwable if the {@link DataSource} has failed
fbcore/src/main/java/com/facebook/datasource/DataSources.java