title: Is it possible to run background operation in RxJava after "Unsubscribe"?
body: <p>Is it possible to run background operation in rxJava after "unscription"?</p>
  
  <p>Ex: I create a stream of 3 strings: A, B, C and I introduce high latency for C and the same latency for A and B. By using the operator first() I unsubscribe too fast to C and C does not have the time to be executed so the unscription kill C. Is there a easy way to leave  C continuing running in the background???</p>
  
  <pre class="lang-java prettyprint-override"><code>    @Test
      public void test_69_b() throws Exception {
          List&lt;String&gt; intList = Arrays.asList("A", "B", "C");
          print("start");
          Observable test = Observable.from(intList)
                                      .flatMap(this::findWrapperS)
                                      .first();
          print("build finnished");
          test.subscribe(this::printAtSub);
          print("End");
          Sleeper.sleep(Duration.ofSeconds(4));
      }
  
      private Observable&lt;String&gt; findWrapperS(String id) {
          return Observable.just(id).doOnUnsubscribe(() -&gt; {
              print("Wrapper &lt;" + id + "&gt; is released");
          })
                           .observeOn(Schedulers.io())
                           .flatMap(i -&gt; Observable.fromCallable(() -&gt; sendBackString(i)));
      }
  
      private String sendBackString(String string) {
  
          switch (string){
              case "C":
                  Sleeper.sleep(Duration.ofMillis(1000));
                  print("Hello " + string);
                  return string;
  
              default:
                  Sleeper.sleep(Duration.ofMillis(10));
                  print("Hello " + string);
                  return string;
          }
      }
  </code></pre>
  
  <pre><code>Given logs
  =================
  18:19:47.806 [Test worker] INFO tests.TestRunner - Got: start
  18:19:47.831 [Test worker] INFO tests.TestRunner - Got: build finnished
  18:19:47.989 [Test worker] INFO tests.TestRunner - Got: End
  18:19:47.994 [Test worker] INFO tests.Sleeper - Sleeping PT4S ms
  18:19:47.998 [RxIoScheduler-2] INFO tests.Sleeper - Sleeping PT0.01S ms
  18:19:47.999 [RxIoScheduler-3] INFO tests.Sleeper - Sleeping PT0.01S ms
  18:19:47.999 [RxIoScheduler-4] INFO tests.Sleeper - Sleeping PT1S ms
  18:19:48.009 [RxIoScheduler-3] INFO tests.TestRunner - Got: Hello B
  18:19:48.010 [RxIoScheduler-3] INFO tests.TestRunner - TERMINAL EVENT ---&gt;: B
  18:19:48.012 [RxIoScheduler-3] INFO tests.TestRunner - Got: Wrapper &lt;A&gt; is released
  18:19:48.013 [RxIoScheduler-3] INFO tests.TestRunner - Got: Wrapper &lt;C&gt; is released
  18:19:48.015 [RxIoScheduler-3] INFO tests.TestRunner - Got: Wrapper &lt;B&gt; is released
  18:19:48.015 [RxIoScheduler-2] INFO tests.TestRunner - Got: Hello A
  18:19:48.021 [RxIoScheduler-4] WARN tests.Sleeper - Sleep interrupted
  java.lang.InterruptedException: sleep interrupted
      at java.lang.Thread.sleep(Native Method)
      at java.lang.Thread.sleep(Thread.java:340)
      at java.util.concurrent.TimeUnit.sleep(TimeUnit.java:386)
      at tests.Sleeper.sleep(Sleeper.java:24)
      at tests.TestRunner.sendBackString(TestRunner.java:249)
      at tests.TestRunner.lambda$null$15(TestRunner.java:242)
      at rx.internal.operators.OnSubscribeFromCallable.call(OnSubscribeFromCallable.java:48)
      at rx.internal.operators.OnSubscribeFromCallable.call(OnSubscribeFromCallable.java:33)
      at rx.Observable.unsafeSubscribe(Observable.java:10211)
      at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:250)
      at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:147)
      at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
      at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:227)
      at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:228)
      at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:748)
  18:19:48.023 [RxIoScheduler-4] INFO tests.TestRunner - Got: Hello C
  </code></pre>