title: RxJava: Know when observable is finished and return Boolean Observable to the caller
body: <p>I am new to RxJava. My experience is mainly from those tutorials:
  <a href="https://www.toptal.com/android/functional-reactive-android-rxjava" rel="nofollow noreferrer">Here</a>, and <a href="https://github.com/ReactiveX/RxAndroid/wiki" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Now, I found myself in a situation where I have API call with Retrofit2 that will return an <code>Obesrvable&lt;AccessToken&gt;</code>. The client will call this service as follows:</p>
  
  <pre><code>public Observable&lt;TokenResult&gt; authenticateWithClientCredentials() {
          return authService.authenticate("client_credentials").take(1);
  }
  </code></pre>
  
  <p>Where a class called <code>Authenticator</code> will call <code>#authenticateWithClientCredentials()</code> from the client.</p>
  
  <p>What I would like to achieve is to return an <code>Observable&lt;Boolean&gt;</code> from the <code>Authenticator</code> class, once the API call is finished, i.e. inside <code>onComplete()</code> to indicate that the access token has been fetched and saved in cache inside the <code>Authenticator</code> class successfully.</p>
  
  <p>I tried the <code>defer</code> operator but I'm still lost.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I know I can pass a callback in the parameters, but isn't the idea of Rx to replace the old classic callbacks approach?</p>