Add “object” type of argument for Plack::Runner #416

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@ChinaXing

just like we discussed in issue : #415

I think support object type of app instead of subroutine type of app is useful ?

I just add two lines of code.

The Test Run passed :)

thanks

@coveralls

This comment has been minimized.

Show comment Hide comment
@coveralls

coveralls Jun 18, 2013

Coverage Status

Coverage decreased (-0%) when pulling 61ef380 on ChinaXing:master into ad053a1 on plack:master.

Coverage Status

Coverage decreased (-0%) when pulling 61ef380 on ChinaXing:master into ad053a1 on plack:master.

@miyagawa

This comment has been minimized.

Show comment Hide comment
@miyagawa

miyagawa Jun 18, 2013

Member

Hmm, sorry, as I pointed out in the other thread, a delayed code that builds a PSGI app is a duplication of Loader functionality, so I suggest looking at there. Or, as I also suggested it, you shouldn't try to (ab)use the restarter code and rather run the fork & Filesys::Notify::Simple to rebuild your blog, without relying on the restarter.

Member

miyagawa commented Jun 18, 2013

Hmm, sorry, as I pointed out in the other thread, a delayed code that builds a PSGI app is a duplication of Loader functionality, so I suggest looking at there. Or, as I also suggested it, you shouldn't try to (ab)use the restarter code and rather run the fork & Filesys::Notify::Simple to rebuild your blog, without relying on the restarter.

@ChinaXing

This comment has been minimized.

Show comment Hide comment
@ChinaXing

ChinaXing Jun 18, 2013

yes, my solution has used your method.

I add this type of argument of Plack::Runner just want to let Plack::Runner's app argument can support an object.

by now, It only support subroutine as a app argument;

a delayed code that builds a PSGI app is a duplication of Loader functionality, so I suggest looking at there

If pass an subroutine to Plack::Runner::run as the app argument, the subroutine will be wrapped as :

 sub { $app }

(https://github.com/plack/Plack/blob/master/lib/Plack/Runner.pm#L160)
this will do nothing just return the subroutine, no builds action.

yes, my solution has used your method.

I add this type of argument of Plack::Runner just want to let Plack::Runner's app argument can support an object.

by now, It only support subroutine as a app argument;

a delayed code that builds a PSGI app is a duplication of Loader functionality, so I suggest looking at there

If pass an subroutine to Plack::Runner::run as the app argument, the subroutine will be wrapped as :

 sub { $app }

(https://github.com/plack/Plack/blob/master/lib/Plack/Runner.pm#L160)
this will do nothing just return the subroutine, no builds action.

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