With dart:io I can do the following
await for (HttpRequest request in requestServer) {
Stream<int> counterStream =
timedCounter(const Duration(seconds: 1), 15).map((int x) => x * 2);
request.response.bufferOutput = false;
counterStream.listen((int data) => request.response.writeln(data),
onDone: () => request.response.close());
}
I was wondering if there was a way in shelf to:
A) Access a request's response, and write stuff to it via a stream.listen()
B) Set the response's bufferOutput to false