title: compose with vertx for sequential code
body: <p>I have two operations step_1() and step_2() and want to execute step_2() AFTER step_1().</p>
  
  <p>With normal java this would be:</p>
  
  <pre><code>step_1();
  step_2();
  </code></pre>
  
  <p>With vertx I have to use vertx-compose(). Am I right?</p>
  
  <p>According to <a href="https://groups.google.com/forum/#!topic/vertx/FuvlPLpoGOA" rel="nofollow noreferrer">https://groups.google.com/forum/#!topic/vertx/FuvlPLpoGOA</a>, I dont need Futures for sequential code. </p>
  
  <blockquote>
    <p>"If you want to do each request sequencially you dont need futures."</p>
  </blockquote>
  
  <p>So how can I do that without using futures?</p>
  
  <p>I dont know, if this matters: My Vertx from which this code is executed is a "Worker"-Verticle.</p>
  
  <pre><code>@Override
  public void start(Future&lt;Void&gt; fut) throws IOException {
  
  Future&lt;Void&gt; step_1 = Future.future();
      step_1.compose(res -&gt; {
          // If the future succeeded
          Future&lt;Void&gt; step_2 = step_1();
  
          step_2.compose(res2 -&gt; {
              step_2();
  
          }, Future.future().setHandler(handler -&gt; {
              // If the future failed
          }));
  
          //I dont need that
      }, Future.future().setHandler(handler -&gt; {
          // If the future failed
      }));
  
  }
  
  public void step_1(){
  ..
  }
  
  public void step_2(){
  ..
  }
  </code></pre>
  
  <p>Is this the right and shortest (!) way?</p>