Flushing support in stream API