library/src/main/java/com/liulishuo/filedownloader/FileDownloadLine.java
public long getSoFar(final int id) {
        if (FileDownloader.getImpl().isServiceConnected()) {
            return FileDownloader.getImpl().getSoFar(id);
        }

        final ConnectSubscriber subscriber = new ConnectSubscriber() {
            private long mValue;

            @Override
            public void connected() {
                mValue = FileDownloader.getImpl().getSoFar(id);
            }

            @Override
            public Object getValue() {
                return mValue;
            }
        };

        wait(subscriber);

        return (long) subscriber.getValue();
    }
public long getSoFar(final int id) {
        if (FileDownloader.getImpl().isServiceConnected()) {
            return FileDownloader.getImpl().getSoFar(id);
        }

        final ConnectSubscriber subscriber = new ConnectSubscriber() {
            private long mValue;

            @Override
            public void connected() {
                mValue = FileDownloader.getImpl().getSoFar(id);
            }

            @Override
            public Object getValue() {
                return mValue;
            }
        };

        wait(subscriber);

        return (long) subscriber.getValue();
    }
The {@link FileDownloader#getSoFar(int)} request.