title: How can I flatMapMany with multiple web calls and conditionally signal complete?
body: <p>I need to write a method which does</p>
  <ul>
  <li>Gets a <code>Location</code> header form an endpoint</li>
  <li>Generates a series of <code>Some</code> which each should retrieved from the <code>Location</code> fetched from the first endpoint.</li>
  <li>Need to return a <code>Flux&lt;Some&gt;</code></li>
  </ul>
  <p>Which looks like this.</p>
  <pre class="lang-java prettyprint-override"><code>private WebClient client;
  
  Flux&lt;Some&gt; getSome() {
  
      // Get the Location header from an endpoint
      client
              .post()
              .exchange()
              .map(r -&gt; r.headers().header(&quot;Location&quot;))
  
      // Now I need to keep invoking the Location endpoint for Some.class
      // And Some.class has an attribute for pending/completion status.
  
      // e.g.
      while (true)
          final Some some = client
              .get()
              .url(...) // the Location header value above
              .retrieve()
              .bodyToMono(Some.class)
              .block()
              ;
      }
  
  }
  </code></pre>
  <p>How can I map the <code>Mono&lt;String&gt;</code> to a <code>Flux&lt;Some&gt;</code> while using the <code>Some#status</code> attribute for completion?</p>
  <pre class="lang-java prettyprint-override"><code>    // should return Flux&lt;Some&gt;
      client
              .post()
              .exchange()
              .map(r -&gt; r.headers().header(&quot;Location&quot;))
              .flatMapMany(location -&gt; {
                  // invokes location while retrieved Some#status is not `completed`
                  // @@?
              })
              ;
  
  </code></pre>