From: Matt S Trout Date: Tue, 4 Oct 2011 21:57:47 +0000 (+0000) Subject: add comment to _to_try for dispatch strategy X-Git-Tag: v0.010~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Simple.git;a=commitdiff_plain;h=c398ce1a9f9de8260705f0c00370b8d7bd93bd00 add comment to _to_try for dispatch strategy --- diff --git a/lib/Web/Dispatch.pm b/lib/Web/Dispatch.pm index 210c297..46961c2 100644 --- a/lib/Web/Dispatch.pm +++ b/lib/Web/Dispatch.pm @@ -105,6 +105,12 @@ sub _redispatch_with_middleware { sub _to_try { my ($self, $try, $more) = @_; + + # sub () {} becomes a dispatcher + # sub {} is a PSGI app and can be returned as is + # '' => sub {} becomes a dispatcher + # $obj w/to_app method is a Plack::App-like thing - call it to get a PSGI app + if (ref($try) eq 'CODE') { if (defined(my $proto = prototype($try))) { $self->_construct_node(match => $proto, run => $try)->to_app;