Skip to content

Is there any way in shelf to return a streamed response ? #54

@Pacane

Description

@Pacane

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions