--- AnyEvent-FCP/FCP.pm 2010/05/31 06:27:37 1.6 +++ AnyEvent-FCP/FCP.pm 2010/06/05 14:49:25 1.7 @@ -8,7 +8,7 @@ my $fcp = new AnyEvent::FCP; -# transactions return condvars + # transactions return condvars my $lp_cv = $fcp->list_peers; my $pr_cv = $fcp->list_persistent_requests; @@ -28,6 +28,24 @@ Only very little is implemented, ask if you need more, and look at the example program later in this section. +=head2 EXAMPLE + +This example fetches the download list and sets the priority of all files +with "a" in their name to "emergency": + + use AnyEvent::FCP; + + my $fcp = new AnyEvent::FCP; + + $fcp->watch_global_sync (1, 0); + my $req = $fcp->list_persistent_requests_sync; + + for my $req (values %$req) { + if ($req->{filename} =~ /a/) { + $fcp->modify_persistent_request_sync (1, $req->{identifier}, undef, 0); + } + } + =head2 IMPORT TAGS Nothing much can be "imported" from this module right now. @@ -44,7 +62,7 @@ use Carp; -our $VERSION = '0.21'; +our $VERSION = '0.3'; use Scalar::Util ();