Document Plack::Util::response_cb #121

Closed
miyagawa opened this Issue Jul 14, 2010 · 8 comments

Comments

Projects
None yet
2 participants
Owner

miyagawa commented Jul 14, 2010

No description provided.

Contributor

markstos commented Dec 25, 2010

I'll work on this.

Owner

miyagawa commented Dec 25, 2010

Don't bother wasting time on this - it's a bit too complicated and hard to grok if you haven't written response mangling middleware. This issue is more of a task rather than "volunteer wanted".

Contributor

markstos commented Dec 25, 2010

Thanks for the vote of confidence.

As I started on this, I noticed the routine didn't have any direct tests, which would help clarify what the docs should be, so I've started by writing some tests, which also help my understanding of the code.

You see what I have so far here:

https://github.com/markstos/Plack/commits/document-response_cb

I do have some questions about the code, though.

On this line:

if ($filter_cb) {

Should there also be checks here like above?

if (defined $filter_cb && ref $filter_cb eq 'CODE') {

And then the's following line:

if ($filter_cb) {
my $writer = $respond->($res)

The spec says that there "MAY" be a writer object used when streaming, but isn't there assuming that always is?

Finally the spec says that a writer object defines, write(), close(), and poll_cb(), but only write() and close() are defined here. Is that a bug?

Owner

miyagawa commented Dec 25, 2010

Finally the spec says that a writer object defines, write(), close(), and poll_cb(), but only write() and close() are defined here. Is that a bug?

No you're looking at the old doc. poll_cb was taken away.

Owner

miyagawa commented Dec 25, 2010

The spec says that there "MAY" be a writer object used when streaming, but isn't there assuming that always is?

You're reading the wrong version of the document. it is MUST.

Contributor

markstos commented Dec 25, 2010

I was reading the version on CPAN, which I assumed to be current. Since the newer version of the spec is already in use, perhaps the spec updates can be officially published soon as well to match. Thanks for the clarifications.

Owner

miyagawa commented Dec 25, 2010

Yeah, publishing the 1.1 spec (i.e. the one on github) is on my TODO when we ship Plack 1.0.

Owner

miyagawa commented Jan 27, 2011

Document response_cb. Closed by be81b50

leedo pushed a commit that referenced this issue Apr 17, 2011

leedo pushed a commit that referenced this issue Apr 17, 2011

Checking in changes prior to tagging of version 0.9968.
Changelog diff is:

diff --git a/Changes b/Changes
index 08ae1ca..14346e1 100644
--- a/Changes
+++ b/Changes
@@ -2,8 +2,11 @@ Revision history for Perl extension Plack

 Take a look at http://github.com/miyagawa/Plack/issues for the planned changes before 1.0 release.

-0.9968
+0.9968  Wed Feb  9 19:07:48 PST 2011
         - Fixed Recursive middleware to rethrow unknown exceptions. #166 (reported by waba)
+        - Document response_cb. #121
+        - Plack::Loader to print errors if it is really a compilation error
+        - Fixed the Cascade app to work with all 404 responses with the streaming interface. #171 (reported by eevee)

 0.9967  Tue Jan 25 14:26:37 PST 2011
         - Fixed StackTrace to require D::ST::WithLexicals 0.08 that supports 'message' (doy)

leedo pushed a commit that referenced this issue Apr 17, 2011

Checking in changes prior to tagging of version 0.9969.
Changelog diff is:

diff --git a/Changes b/Changes
index 14346e1..11607cb 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,13 @@ Revision history for Perl extension Plack

 Take a look at http://github.com/miyagawa/Plack/issues for the planned changes before 1.0 release.

+0.9969  Fri Feb 18 21:35:29 PST 2011
+        - Suppress the use of unlocalized $_ in Plack::Runner (mst)
+        - Plack::Handler::Net::FastCGI is now removed from Plack core dist.
+          It will be released as a separate distribution on CPAN.
+        - Fixed Plack::Handler::Apache2 so that it can safely call log (Andy Wardley)
+        - StackTrace: Display graceful fallback errors when $SIG{__DIE__} is overridden in the application (mkanat)
+
 0.9968  Wed Feb  9 19:07:48 PST 2011
         - Fixed Recursive middleware to rethrow unknown exceptions. #166 (reported by waba)
         - Document response_cb. #121

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment