title: RxJava single background thread scheduler
body: <p>I'm fairly new to RxJava so this is probably a dumb question. I am going to describe my scenario. </p>
  
  <p>I have some code running on the UI thread which will update some images but those images are not very important and they consume a bit of resources while generating them so I want to generate them on a single thread (not the UI thread of course) and generate them one by one. I'm guessing the trampoline scheduler is what I want but my problem is that if I use it then it does the work on the UI thread and I want it to do it on another thread. </p>
  
  <p>Obviously I can write my own thread in which I can queue items and then it processes those one by one but I thought maybe RxJava would have a simple solution for me? </p>
  
  <p>My current code looks like this:</p>
  
  <pre><code>Observable&lt;Bitmap&gt; getImage = Observable.create(new Observable.OnSubscribe&lt;Bitmap&gt;() {
      @Override public void call(Subscriber&lt;? super Bitmap&gt; subscriber) {
          Log.w(TAG,"On ui thread? "+ UIUtils.isRunningOnUIThread());
          subscriber.onNext(doComplexTaskToGetImage());
          subscriber.onCompleted();
      }
  });
  
  getImage.subscribeOn(Schedulers.trampoline()).subscribe(new Action1&lt;Bitmap&gt;() {
      @Override public void call(Bitmap bitmap) {
          codeToSetTheBitmap(bitmap);
      }
  });
  </code></pre>
  
  <p>My log that says "On ui thread?" always has true. So how do I make that code and all subsequent attempts to do the same thing run on a single thread (not the ui thread) in order without writing a bunch of code to queue that work? </p>
  
  <p>Edit:</p>
  
  <p>I believe that this can now be accomplished using <code>Schedulers.single()</code> or if you want your own you can use <code>new SingleScheduler()</code>. I'm still testing but I think it does what I wanted back when I posted this. </p>