title: RxJava - parallel execution of two API calls
body: <p>I have a SyncService.</p>
  
  <pre><code>@Override
  public int onStartCommand(Intent intent, int flags, final int startId) {
      Timber.i("Starting sync...");
      ...
      RxUtil.unsubscribe(mSubscription);
      mSubscription = mDataManager.syncEvents()
              .subscribeOn(Schedulers.io())
              .subscribe(new Observer&lt;Event&gt;() {
                  @Override
                  public void onCompleted() {
                      Timber.i("Synced successfully!");
                      stopSelf(startId);
                  }
  
                  @Override
                  public void onError(Throwable e) {
                      Timber.w(e, "Error syncing.");
                      stopSelf(startId);
  
                  }
  
                  @Override
                  public void onNext(Event event) {
                  }
              });
  
      return START_STICKY;
  }
  </code></pre>
  
  <p>Observable events = mDataManager.syncEvents() is an API call.</p>
  
  <p>I want to do a parallel call:</p>
  
  <p>Single userInfo = mDataManager.getUserInfo()</p>
  
  <p>and call stopSelf(startId); after these two calls will finish.</p>
  
  <p>How can I do it?</p>
  
  <p>I tried <a href="https://stackoverflow.com/questions/26249030/rxjava-fetching-observables-in-parallel">RxJava Fetching Observables In Parallel</a>
  but this is a little different case.</p>
  
  <p>I think I have to use .zip or .merge method. But in my case one method call returns Observable (list on Events) and second Single (one UserInfo object).</p>
  
  <p>I created z result class which could be a result of .zip method, but I don't know how to fill it:</p>
  
  <pre><code>public class SyncResponse {
       List&lt;Event&gt; events;
       UserInfo userInfo;
       ...
  }
  </code></pre>