kazeburo/Plack-Middleware-Scope-Container — pull request #1 by motemen (2012-08-07 05:58:29+00:00)
Title: Keep `Scope::Container` reference in `$env` for streaming response

`$mw->response_cb($res, \&cb)`'s `&cb` is called when the response is first created and not the response finished, especially when streaming. So when you start a streaming response and want to write it afterwards, the `Scope::Container` is destroyed when you get streaming $writer. (41ee626d01121e85625d421691b6dab3fe4607bb)

To solve this problem, I think keeping `Scope::Container` reference in `$env` would be good, whose reference is keeped until the streaming subroutine ends.