Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChinaXing
Copy link

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
Copy link

Coverage Status

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

@miyagawa
Copy link
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.

@ChinaXing
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants