# Using RxJava and Glide to download multiple GIFs
[SOURCE](https://stackoverflow.com/a/31893556/1602807)
This guide is for RxJava 1 and Glide v3 (3.8.0).
Have a list of URLs to GIFs, how to download them all in separated threads and proceed when all GIFs are downloaded?
```java
private void download(final List<String> urlList) {
Observable observable = Observable.from(urlList)
.flatMap(new Func1<String, Observable<File>>() {
@Override
public Observable<File> call(String url) {
return getDownloadObservable(url);
}
});
mSubscriptions.add(observable
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<File>() {
@Override
public void onCompleted() {
Timber.d("onCompleted(): DEBUG_GLIDE_DOWNLOAD");
}
@Override
public void onError(Throwable e) {
Timber.d("onError(): DEBUG_GLIDE_DOWNLOAD e: %s", e.getMessage());
}
@Override
public void onNext(File file) {
Timber.d("onNext(): DEBUG_GLIDE_DOWNLOAD file path: %s", file.getPath());
}
}));
}
private Observable<File> getDownloadObservable(final String url){
//need fromCallable as downloadOnly need to be put in a background thread
//if not we can just use just as in the source
return Observable.fromCallable(new Callable<File>() {
@Override
public File call() throws Exception {
return Glide.with(mWeakContext.get())
.load(url)
.downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
.get();
}
});
}
```