Skip to content

Long-term plan for futures #27

Closed as not planned
Closed as not planned
@tomaka

Description

@tomaka

The request's headers will be entirely parsed before the handler is called, but the request's body will be a Stream.
The handler will be able to return a Future<Item = Response> instead of simply a Response.

In practice, this means that as soon as the headers of a request are parsed, the handler is called. The handler then quickly builds a future and quickly returns. Then it's the library's code that will, through an events loop, advance the actual processing of the request.

The user's code will probably look much messier when using futures, but that's a problem specific to Rust that may eventually be solved by adding async/await to the language.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions