title: RxJava - Why the executors only use one thread
body: <p>I have created a fixed thread-pool to process an event emit per 300 milliseconds and assume the process need 1000 millisecond. Suppose the multi-thread will work but only one thread reused.</p>
  
  <p>If i set the sleepTime smaller than 300ms, the processing thread change, but that is useless.</p>
  
  <p>Questions: What can I do to make it concurrent? Why the program reuse the thread?</p>
  
  <p>Thank you in advance</p>
  
  <pre><code>public static void main(String[] args) throws InterruptedException {
      long sleepTime = 1000;
      ExecutorService e = Executors.newFixedThreadPool(3);
  
      Observable.interval(300, TimeUnit.MILLISECONDS)
      .subscribeOn(Schedulers.computation())
      .flatMap(new Func1&lt;Long, Observable&lt;Long&gt;&gt;() {
          @Override
          public Observable&lt;Long&gt; call(Long pT) {
              return Observable.just(pT).subscribeOn(Schedulers.from(e));
          }
      })
      .doOnNext(new Action1&lt;Long&gt;() {
  
          @Override
          public void call(Long pT) {
              try {
                  Thread.sleep(sleepTime);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
  
          }
      })
      .subscribe(new Action1&lt;Long&gt;() {
  
          @Override
          public void call(Long pT) {
              System.out.println("i am " + pT + "in thread:" + Thread.currentThread().getName());
  
          }
      });
  
  
      Thread.sleep(50000);
      e.shutdownNow();
  
  }
  </code></pre>
  
  <p>Logs</p>
  
  <pre><code>i am 0in thread:pool-1-thread-1
  i am 1in thread:pool-1-thread-1
  i am 2in thread:pool-1-thread-1
  i am 3in thread:pool-1-thread-1
  i am 4in thread:pool-1-thread-1
  i am 5in thread:pool-1-thread-1
  i am 6in thread:pool-1-thread-1
  i am 7in thread:pool-1-thread-1
  i am 8in thread:pool-1-thread-1
  i am 9in thread:pool-1-thread-1
  i am 10in thread:pool-1-thread-1
  i am 11in thread:pool-1-thread-1
  </code></pre>