AnyEvent-FCP
view release on metacpan or search on metacpan
=head2 FCP REQUESTS
The following methods implement various requests. Most of them map
directory to the FCP message of the same name. The added benefit of
these over sending requests yourself is that they handle the necessary
serialisation, protocol quirks, and replies.
All of them exist in two versions, the variant shown in this manpage, and
a variant with an extra C<_> at the end, and an extra C<$cb> argument. The
version as shown is I<synchronous> - it will wait for any replies, and
either return the reply, or croak with an error. The underscore variant
returns immediately and invokes one or more callbacks or condvars later.
For example, the call
$info = $fcp->get_plugin_info ($name, $detailed);
Also comes in this underscore variant:
$fcp->get_plugin_info_ ($name, $detailed, $cb);
=head1 EXAMPLE PROGRAM
use AnyEvent::FCP;
my $fcp = new AnyEvent::FCP;
# let us look at the global request list
$fcp->watch_global_ (1);
# list them, synchronously
my $req = $fcp->list_persistent_requests;
# go through all requests
TODO
for my $req (values %$req) {
# skip jobs not directly-to-disk
next unless $req->{return_type} eq "disk";
# skip jobs not issued by FProxy
next unless $req->{identifier} =~ /^FProxy:/;
callback. See "FCP REQUESTS" for details.
FCP REQUESTS
The following methods implement various requests. Most of them map
directory to the FCP message of the same name. The added benefit of
these over sending requests yourself is that they handle the necessary
serialisation, protocol quirks, and replies.
All of them exist in two versions, the variant shown in this manpage,
and a variant with an extra "_" at the end, and an extra $cb argument.
The version as shown is *synchronous* - it will wait for any replies,
and either return the reply, or croak with an error. The underscore
variant returns immediately and invokes one or more callbacks or
condvars later.
For example, the call
$info = $fcp->get_plugin_info ($name, $detailed);
Also comes in this underscore variant:
}
EXAMPLE PROGRAM
use AnyEvent::FCP;
my $fcp = new AnyEvent::FCP;
# let us look at the global request list
$fcp->watch_global_ (1);
# list them, synchronously
my $req = $fcp->list_persistent_requests;
# go through all requests
TODO
for my $req (values %$req) {
# skip jobs not directly-to-disk
next unless $req->{return_type} eq "disk";
# skip jobs not issued by FProxy
next unless $req->{identifier} =~ /^FProxy:/;
( run in 0.235 second using v1.01-cache-2.11-cpan-0d8aa00de5b )