Skip to content

Considerations for response body implementing #call. #1550

@ioquatix

Description

@ioquatix

I would like to update the SPEC in Rack 3 to allow the response body to respond to #call and remove all rack. response headers (e.g. rack.hijack).

The response should be the same as currently defined, e.g.

[status, headers, body] where body can respond to #each or, in Rack 3, #call.

The argument to the #call is a stream object, similar to rack.hijack.

The benefits are:

  • Simpler SPEC.
  • More efficient server implementation.

The challenges are:

  • Existing middleware which responds with [status, headers, self.dup] where self implements #call(env). I don't think this is a good pattern anyway, so we should find and eradicate it in the rack code base in preparation for this change in Rack 3, if we decided to go with this approach.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions