-
Notifications
You must be signed in to change notification settings - Fork 12
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
PSGI protocol for HTTP::Tiny #34
Comments
This is a really good idea. LWP::Protocol::PSGI demonstrates really deep understanding of how PSGI works. While the final solution is fairly simple (as in the opposite of the "I'm sorry this letter is so long, I didn't have time to write a short one" kind of way) it demonstrates a deep understanding of the way everything works. Providing an independent demonstration of that depth of understanding would be really useful. |
Is this an idea that you are proposing to work with during GSoC? Would anyone here be willing to mentor it? |
neither of us have sufficient student status. It's a suggested project. Highly constrained problem space, and just tricky enough to be interesting thus high probability of success. |
It's a very interesting idea, but it's 6 days away from final proposal by
students. Without mentors, and so late in the game, it's unlikely that's it's
taken up by someone. Thanks anyway!
|
:( |
Well, who knows, someone might find it and be interested... But in that case, I would very strongly suggest that you propose yourself as a mentor, or find someone who would be willing to do so. Mentoring is a nice contribution to the community, and you learn a lot... |
Mentoring a newborn on life is currently dominating my time :) Thanks though. |
I chatted with @djzort about this on #soc-help and would be fine with mentoring a student on it. |
That would be great. Please prepare then a full document with this and
include yourself as mentor. Students will be looking at them.
|
See also chansen/p5-http-tiny#130 |
I have rolled this in to 2020 perl-foundation-outreach/gsoc-2020-ideas#5 Assuming @tmetro and @singingfish are still ok |
The https://metacpan.org/pod/LWP::Protocol::PSGI module allows you to provide code that will called to respond to requests you make with LWP, rather than them going off to a server.
A GSoC student would author something analogous, but for HTTP::Tiny.
The pod of LWP::Protocol::PSGI has a good example, where a trivial dancer app is loaded to respond to LWP requests to google.com. In a test file, an author can mock a web service without having to start up a http daemon of some sort, and doesnt need to insert shims in their code either. Another example from the real world is https://metacpan.org/source/HAKOBE/WebService-SyoboiCalendar-0.02/t/lib/SyobocalMock.pm. The code being tested in entirely unaware of the subterfuge.
A version for HTTP::Tiny would do something very similar. Authors of code using HTTP::Tiny could use this new HTTP::Tiny w/ PSGI in their test suites to mock web services they want to test against.
LWP is multiprotocol, so lends itself to having PSGI added. For HTTP::Tiny to speak to something via PSGI, the Student would need to do something like:
use HTTP::Tiny::FakeViaPSGI; # This fakes the HTTP::Tiny namespace
use HTTP::Tiny; # This then does nothing other than call HTTP::Tiny->import, as %INC already contains an entry for HTTP::Tiny
The text was updated successfully, but these errors were encountered: