title: Long Polling with RxSwift
body: <p>I want to make a simple long polling request with RxSwift which may be the similar to RxJava code below:</p>
  
  <pre><code>api.loadHotels(searchRequest)
      .repeatWhen(obs -&gt; observable.delay(3, TimeUnit.SECONDS))
      .takeUntil(searchResponse -&gt; searchResponse.isCompleted)
      .subscribe(listener::hotelListLoaded);
  </code></pre>
  
  <p>In RxSwift, there is a <a href="https://github.com/RxSwiftCommunity/RxSwiftExt/issues/38" rel="nofollow">repeatWhen</a> operator that takes an ObservableConvertibleType as a parameter, not passing the chained Observable to its closure as an argument, unlike its synonym in RxJava.</p>
  
  <p>What I expected in RxSwift: <code>api.loadHotels(searchRequest).repeatWhen{result -&gt; ObservableConvertibleType}</code> so I can write the exact same logic as RxJava code. But I cannot achieve this. Because it is only as <code>api.loadHotels(searchRequest).repeatWhen(ObservableConvertibleType)</code> The exact same thing applies for RxSwift's <code>takeUntil</code> operator.</p>
  
  <p>However I also tried:
  <a href="https://github.com/RxSwiftCommunity/RxSwiftExt/issues/38" rel="nofollow">repeatWhen operator in RxSwift</a> and
  <a href="https://github.com/ReactiveX/RxSwift/issues/396" rel="nofollow">repeatWhen substituter in RxSwift</a></p>
  
  <p>So my question is: how can I achieve the same logic in RxSwift as the given RxJava code? Am I getting the workflow of current <code>repeatWhen</code> and <code>takeUntil</code> operators of RxSwift wrong?</p>