NAME
WWW::CurlOO::Multi - Perl interface for curl_multi_* functions
WARNING
THIS MODULE IS UNDER HEAVY DEVELOPEMENT AND SOME INTERFACE MAY CHANGE YET.
SYNOPSIS
use WWW::CurlOO::Multi qw(:constants);
my $multi = WWW::CurlOO::Multi->new();
$multi->add_handle( $easy );
my $running = 0;
do {
my ($r, $w, $e) = $multi->fdset();
my $timeout = $multi->timeout();
select $r, $w, $e, $timeout / 1000
if $timeout > 0;
$running = $multi->perform();
while ( my ( $easy, $result, $msg ) = $multi->info_read() ) {
$multi->remove_handle( $easy );
# process $easy
}
} while ( $running );
DESCRIPTION
This module wraps multi handle from libcurl and all related functions and constants. It does not export by default anything, but constants can be exported upon request.
use WWW::CurlOO::Multi qw(:constants);
METHODS
- CLASS->new( [BASE] )
-
Creates new WWW::CurlOO::Multi object. If BASE is specified it will be used as object base, otherwise an empty hash will be used. BASE must be a valid reference which has not been blessed already. It will not be used by the object.
Calls curl_multi_init(3) and presets some defaults.
- OBJECT->add_handle( EASY )
-
Add WWW::CurlOO::Easy to this WWW::CurlOO::Multi object.
Calls curl_multi_add_handle(3).
- OBJECT->remove_handle( EASY )
-
Remove WWW::CurlOO::Easy from this WWW::CurlOO::Multi object.
Calls curl_multi_remove_handle(3).
- OBJECT->info_read( )
-
Read last message from this Multi.
Calls curl_multi_info_read(3).
- OBJECT->fdset( )
-
Returns read, write and exception vectors suitable for select() and vec() perl builtins.
Calls curl_multi_fdset(3).
- OBJECT->timeout( )
-
Returns timeout value.
Calls curl_multi_timeout(3).
- OBJECT->setopt( OPTION, VALUE )
-
Set an option. OPTION is a numeric value, use one of CURLMOPT_* constants. VALUE depends on whatever that option expects.
Calls curl_multi_setopt(3).
- OBJECT->perform( )
-
Perform.
Calls curl_multi_perform(3).
- OBJECT->socket_action( [SOCKET], [BITMASK] )
-
Signalize action on a socket.
Calls curl_multi_socket_action(3).
- OBJECT->DESTROY( )
-
Cleans up. It should not be called manually.
Calls curl_multi_cleanup(3).
FUNCTIONS
- strerror( [WHATEVER], CODE )
-
Return a string for error code CODE.
See curl_multi_strerror(3) for more info.
SEE ALSO
COPYRIGHT
Copyright (c) 2011 Przemyslaw Iskra <sparky at pld-linux.org>.
You may opt to use, copy, modify, merge, publish, distribute and/or sell copies of the Software, and permit persons to whom the Software is furnished to do so, under the terms of the MPL or the MIT/X-derivate licenses. You may pick one of these licenses.