title: Implement retryWhen logic
body: <p>I have an app which requires session (cookies) to process web calls. Im using <code>Retrofit+RxJava</code>. However, session could expire (Retrofit error with 401 Unauthorized status) and i want to reauthenticate (to get fresh cookies) and retry previous call in this case. How would i do it with <code>RxJava</code>?</p>
  
  <p>My example:</p>
  
  <pre><code>getServerApi().getDialogs(offset, getCookies())
       .subscribeOn(Schedulers.newThread())
       .observeOn(AndroidSchedulers.mainThread())
       .retryWhen(observable -&gt; {...}) // Need some logic
       .subscribe(dialogsEnvelope -&gt; getView().setDialogs(dialogsEnvelope),
                  throwable -&gt; getView().setError(processFail(throwable)));
  </code></pre>