-
-
30 Jun 2019 08:19:09 UTC
- Distribution: IO-Lambda
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (0)
- Testers (562 / 103 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (90.24KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- LWP
- Net::DNS
- Scalar::Util
- Storable
- Sub::Name
- Time::HiRes
- URI
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
IO::Lambda::HTTP - http requests lambda style
DESCRIPTION
The module exports a single condition
http_request
that accepts aHTTP::Request
object and set of options as parameters. The condition returns either aHTTP::Response
on success, or an error string otherwise.SYNOPSIS
use HTTP::Request; use IO::Lambda qw(:all); use IO::Lambda::HTTP qw(http_request); lambda { context shift; http_request { my $result = shift; if ( ref($result)) { print "good: ", length($result-> content), " bytes\n"; } else { print "bad: $result\n"; } } }-> wait( HTTP::Request-> new( GET => "http://www.perl.com/") );
API
- http_request $HTTP::Request -> $HTTP::Response
-
http_request
is a lambda condition that acceptsHTTP::Request
object in the context. Returns either aHTTP::Response
object on success, or error string otherwise. - new $HTTP::Request :: () -> $HTTP::Response
BUGS
Non-blocking connects, and hence the module, don't work on win32 on perl5.8.X due to under-implementation in ext/IO.xs. They do work on 5.10 however.
SEE ALSO
AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>.
Module Install Instructions
To install IO::Lambda, copy and paste the appropriate command in to your terminal.
cpanm IO::Lambda
perl -MCPAN -e shell install IO::Lambda
For more information on module installation, please visit the detailed CPAN module installation guide.