Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Proposed spec change: support immutable data structures #40

@panesofglass

Description

@panesofglass

The existing specification for OWIN makes it difficult to leverage immutable data structures for the required IDictionary<string, object> environment and IDictionary<string, string[]> headers dictionaries. While it's unlikely that we will ever move away from Stream, a simple spec change would allow those of us who want immutable IDictionary types to do so: type AppFunc = Func<IDictionary<string, object>, Task<IDictionary<string, object>>>.

This signature could be used by existing implementations rather easily by simply returning the environment dictionary instance. However, for those using immutable data structures, this signature allows such implementations to return the new instance as it is passed along through the middleware chain or modified by the running application.

No changes would be required for the other existing or proposed signatures, which already return instances of one thing or another.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions