title: Recommended way to execute async tasks with RXJava
body: <p>I'm new to RxJava and I'm trying to understand the best/recommended way to perform long running tasks asynchronously (e.g. network requests). I've read through a lot of examples online but would appreciate some feedback.</p>
  
  <p>The following code works (it prints 'one', 'two', then 'User: x' ... etc) but should I really be creating/managing Threads manually?</p>
  
  <p>Thanks in advance!</p>
  
  <pre><code>public void start() throws Exception {
      System.out.println("one");
      observeUsers()
          .flatMap(users -&gt; Observable.from(users))
          .subscribe(user -&gt; System.out.println(String.format("User: %s", user.toString()));
      System.out.println("two");
  }
  
  Observable&lt;List&lt;User&gt;&gt; observeUsers() {
      return Observable.&lt;List&lt;User&gt;&gt;create(s -&gt; {
          Thread thread = new Thread(() -&gt; getUsers(s));
          thread.start();
      });
  }
  
  void getUsers(final Subscriber s) {
      s.onNext(userService.getUsers());
      s.onCompleted();
  }
  
  // userService.getUsers() fetches users from a web service.
  </code></pre>