Skip to content

Router: allow methods to return an async-iterator or a readable stream #122

@bajtos

Description

@bajtos

Right now, Controller methods are returning a single response object that's later written to the HTTP response body.

Let's add support for two more advanced response modes:

  • A method returning an async iterator instead of in-memory array instance - see e.g. KeyValueModel.iterateKeys

  • A method returning a readable stream. The stream can be either "regular" text/binary stream, but also a stream in object mode, where the framework is expected to serialize the objects to JSON/XML/etc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions