提出並行請求
你可以使用 zip
運算子並行生成請求並組合結果,例如:
Observable.zip(api.getRepo(repoId1), api.getRepo(repoId2), (repo1, repo2) ->
{
//here you can combine the results
}).subscribe(/*do something with the result*/);
你可以使用 zip
運算子並行生成請求並組合結果,例如:
Observable.zip(api.getRepo(repoId1), api.getRepo(repoId2), (repo1, repo2) ->
{
//here you can combine the results
}).subscribe(/*do something with the result*/);