Forwarding from a futures::Stream to a futures::Sink : <p>I am currently trying to wrap my head around the tokio &amp; futures primitives and ecosystem.</p>

<p>I started doing some work from the <a href="https://github.com/swindon-rs/tk-http/blob/abfdb50a00ab90b4f01b23ff8dbefe6e83331d9c/examples/websockets.rs" rel="noreferrer">tk-http websockets example</a>, and wanted to do more processing on the received data rather than echoing it back. A first step seemed to be to replace the .forward() call with some kind of loop.</p>

<p>It seemed to me that <code>stream.forward(sink)</code> is equivalent to <code>stream.fold(sink, |out_, item| { out.send(item).and_then(Sink::flush) })</code>, however doing this (<a href="https://gitlab.com/remram44/rs-web/commit/b1edd5a68ddb676b6a912576bdf08600cbeab96e" rel="noreferrer">commit</a>) the stream is not polled at all. However the same change from the Tokio example works fine (<a href="https://gitlab.com/remram44/rs-web/commit/5345a3e7f5f4e4ec81791d5e7e0474154329bd0e" rel="noreferrer">example</a>).</p>

<p>Furthermore, it seems that outputting something on the sink first makes the forwarding work fine (<a href="https://gitlab.com/remram44/rs-web/commit/d690039fde5d4d6ab35f0f0a13be3ef46c84807b" rel="noreferrer">commit</a>), so maybe the sink doesn't get registered with the event loop for some reason until a send happen? Did I miss something? Is it possible it is a bug in tk-http?</p>
