Is it possible to restart a boost::future?
<p>I'm playing with boost::future .then() feature. I wrote a small reactor which reads files in an asynchronous way. There is a function readFileAsync(int fd) which returns a future for a data from the file. That reactor will read up to a fixed amount of bytes when descriptor is ready and fulfil the promise. I'm stuck however at deciding how to restart the future if there can be more data from the file. What is the patter for doing this?</p>

<pre><code>readFileAsync(fd).then([&amp;](auto future) {
  auto data = future.get();
  if (data.block.empty()) { // end of file
     close(data.fd);  
  } else {
   readFileAsync(data.fd).then(...); // XXX: how to work that out?
  }
});
</code></pre>