First, thank you for the futures crate, I like it very much so far, both with
The goal was to modularize the application logic into many small futures and then compose them to act on a
I worry though about the
rustc resource usage w.r.t. time and memory. Maybe it is wrong in the first place to try to design the application as a big future-driven state machine, but already with about 10
.and_then() chained on a
Stream, compilation takes more than 2 minutes and peaks at several GB of RAM.
That happens even if the code itself is trivial, like
.map( |item| item) or
.and_then( |item| ok(item) ). I guess the combinatorics of the different
Err branches grows out of control?
Is there some trick to keep the combinatorics for
rustc manageable? I tried to give type hints in some places, but so far that did not help at all.
In general, how can one partition an application in a better way using futures? Thank you!