view release on metacpan or search on metacpan
lib/Any/Renderer/Template.pm view on Meta::CPAN
=back
=head1 GLOBAL VARIABLES
The package-level template cache is created on demand the first time it's needed.
There are a few global variables which you can tune before it's created (i.e. before you create any objects):
=over 4
=item $Any::Renderer::Template::CacheMaxItems
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Any/Template.pm view on Meta::CPAN
die("Hash or array refs not supported as sinks") if(ref $collector eq "HASH" || ref $collector eq "ARRAY");
return $self->{backend}->process_to_string($data, $collector) if(ref $collector eq "SCALAR");
return $self->{backend}->process_to_sub($data, $collector) if(ref $collector eq "CODE");
return $self->{backend}->process_to_filehandle($data, $collector) if(ref $collector eq "GLOB"); #Filehandle ref
return $self->{backend}->process_to_filehandle($data, \$collector) if(ref \$collector eq "GLOB"); #Filehandle
return $self->{backend}->process_to_file($data, $collector) if(not ref $collector); #Must come after check for glob
return $self->{backend}->process_to_filehandle($data, $collector); #object - treat as a filehandle
}
#Log::Trace stubs
sub TRACE{}
lib/Any/Template.pm view on Meta::CPAN
=item $template->process($data_structure, $sink);
$sink can be:
- a scalar ref
- a filename (string)
- a filehandle (as a glob or glob ref) or an object offering a print method
- a coderef (output will be passed in as the first argument)
=item $string = $template->process($data_structure);
A convenience form, if no second argument is passed to C<process()>, equivalent to:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyDBM_File/Importer.pm view on Meta::CPAN
BEGIN {
@AnyDBM_File::ISA = qw( DB_File SDBM_File ) unless @AnyDBM_File::ISA;
}
use AnyDBM_File;
use vars qw( $DB_BTREE &R_DUP); # must declare the globals you expect to use
use AnyDBM_File::Importer qw(:bdb); # an import tag is REQUIRED
my %db;
$DB_BTREE->{'flags'} = R_DUP;
tie( %db, 'AnyDBM_File', O_CREAT | O_RDWR, 0644, $DB_BTREE);
lib/AnyDBM_File/Importer.pm view on Meta::CPAN
=head1 USAGE NOTES
Use of L<AnyDBM_File::Importer> within module code currently requires
a kludge. Symbols of imported variables or constants need to be
declared globals, as in the SYNOPSIS above. This is not necessary when
L<AnyDBM_File::Importer> is used in package main. Better solutions are hereby solicited with advance gratitude.
L<AnyDBM_File::Importer> consists entirely of an import function. To
import the symbols, a tag must be given. More than one tag can be
supplied. Symbols cannot be individually specified at the moment.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
eg/simple_client.pl
lib/AnyEvent/BitTorrent.pm
minil.toml
t/000_tests/001_compile.t
t/000_tests/002_basic.t
t/000_tests/004_global.t
t/000_tests/005_local.t
t/800_utils/Tracker.pm
t/800_utils/Tracker/HTTP.pm
t/900_data/kubuntu-active-13.04-desktop-i386.iso.torrent
META.yml
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/CacheDNS.pm view on Meta::CPAN
=head1 METHODS
=head2 register
Registers a new DNS cache instance as AnyEvent's global DNS resolver.
=head2 ENVIRONMENT
=over
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-logic.t view on Meta::CPAN
use strict;
use warnings;
use AnyEvent::ConnPool;
use Test::More;
my $global_counter = 1;
my $connpool = AnyEvent::ConnPool->new(
constructor => sub {
return {value => $global_counter++};
},
size => 10,
);
$connpool->init();
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
my $cur = _load($mod);
if (_version_cmp ($cur, $arg) >= 0)
{
print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
push @Existing, $mod => $arg;
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
if (not defined $cur) # indeed missing
{
print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
$DisabledTests{$_} = 1 for map { glob($_) } @tests;
}
}
if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
require Config;
inc/Module/AutoInstall.pm view on Meta::CPAN
}
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join( ' ',
grep { !exists( $DisabledTests{$_} ) }
map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
my $missing = join( ',', @Missing );
my $config =
join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
t/30-error-cb.t view on Meta::CPAN
use AnyEvent::Consul;
{
my $cv = AE::cv;
my $global_error = 0;
my $agent = AnyEvent::Consul->agent(error_cb => sub { $global_error++; $cv->send });
ok $agent, "got Agent API object";
lives_ok { $agent->members } "failing call with global error callback succeeds";
$cv->recv;
ok $global_error, "global error callback was called";
}
{
my $cv = AE::cv;
t/30-error-cb.t view on Meta::CPAN
ok $error, "error callback was called";
}
=pod
{
my $global_error = 0;
my $agent = AnyEvent::Consul->agent(error_cb => sub { $global_error++ });
ok $agent, "got Agent API object with global error callback";
lives_ok { $agent->members } "failing call with global error callback succeeds";
ok $global_error, "global error callback was called";
{
$global_error = 0;
my $error = 0;
lives_ok { $agent->members(error_cb => sub { $error++ }) } "failing call with error callback succeeds";
ok $error, "error callback was called";
ok !$global_error, "global error callback was not called";
}
}
=cut
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
my $cur = _load($mod);
if (_version_cmp ($cur, $arg) >= 0)
{
print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
push @Existing, $mod => $arg;
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
if (not defined $cur) # indeed missing
{
print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
$DisabledTests{$_} = 1 for map { glob($_) } @tests;
}
}
if ( @Missing and not( $CheckOnly or $UnderCPAN) ) {
require Config;
inc/Module/AutoInstall.pm view on Meta::CPAN
}
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join( ' ',
grep { !exists( $DisabledTests{$_} ) }
map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
my $missing = join( ',', @Missing );
my $config =
join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Curl/Multi.pm view on Meta::CPAN
$client->max_concurrency(10);
A value of 0 means no limit will be imposed.
You can also set global default behaviors for requests:
=over
=item timeout => PERIOD
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/AutoInstall.pm view on Meta::CPAN
my $cur = _load($mod);
if (_version_cmp ($cur, $arg) >= 0)
{
print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
push @Existing, $mod => $arg;
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
if (not defined $cur) # indeed missing
{
print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
inc/Module/AutoInstall.pm view on Meta::CPAN
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
$DisabledTests{$_} = 1 for map { glob($_) } @tests;
}
}
if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
require Config;
inc/Module/AutoInstall.pm view on Meta::CPAN
}
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join( ' ',
grep { !exists( $DisabledTests{$_} ) }
map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
my $missing = join( ',', @Missing );
my $config =
join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
- do not leave zombie processes (Adam Rosenstein).
2.1 Sat Oct 30 22:22:05 CEST 2010
- no longer kill -9 the child, just kill -TERM and close the connection,
to avoid database corruption - this also works around a perl bug
(global destruction).
- convert to the faster AE API - major speedup.
- use common::sense.
2.0 Mon Jun 29 10:18:58 CEST 2009
- INCOMPATIBLE CHANGE: callbacks now are passed the $dbh
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/DNS/EtcHosts.pm view on Meta::CPAN
$ perl -MAnyEvent::DNS::EtcHosts script.pl
=for markdown ```
Enables this module globally. Additional arguments will be passed to
L<AnyEvent::DNS> constructor.
=cut
sub import {
lib/AnyEvent/DNS/EtcHosts.pm view on Meta::CPAN
$GUARD = $class->register(%args);
}
=head2 no AnyEvent::DNS::EtcHosts
Disables this module globally.
=cut
sub unimport {
my ($class) = @_;
lib/AnyEvent/DNS/EtcHosts.pm view on Meta::CPAN
Enables this module in lexical scope. The module will be disabled out of
scope. Additional arguments will be passed to L<AnyEvent::DNS> constructor.
If you want to use AnyEvent::DNS::EtcHosts in lexical scope only, you should
use C<require> rather than C<use> keyword, because C<import> method enables
AnyEvent::DNS::EtcHosts globally.
=cut
sub register {
my ($class, %args) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/eris/Server.pm view on Meta::CPAN
my $client_streams = delete $self->clients->{$SID}{'streams'}{$stream};
# FIXME:
# I *think* what this is supposed to do is delete assists
# that were registered for this client, which it doesn't
# - it deletes global assists instead - this needs to be
# looked into
if ($client_streams) {
if ( my $assist = $_STREAM_ASSISTERS{$stream} ) {
foreach my $key ( keys %{$client_streams} ) {
--$self->{'assists'}{$assist}{$key} <= 0
view all matches for this distribution
view release on metacpan or search on metacpan
use AnyEvent::FCP;
my $fcp = new AnyEvent::FCP;
$fcp->watch_global (1, 0);
my $req = $fcp->list_persistent_requests;
TODO
for my $req (values %$req) {
if ($req->{filename} =~ /a/) {
1
},
);
};
=item $fcp->watch_global ($enabled[, $verbosity_mask])
=cut
_txn watch_global => sub {
my ($self, $ok, $err, $enabled, $verbosity_mask) = @_;
$self->send_msg (watch_global =>
enabled => $enabled ? "true" : "false",
defined $verbosity_mask ? (verbosity_mask => $verbosity_mask+0) : (),
);
$ok->();
1
});
});
};
=item $sync = $fcp->modify_persistent_request ($global, $identifier[, $client_token[, $priority_class]])
Update either the C<client_token> or C<priority_class> of a request
identified by C<$global> and C<$identifier>, depending on which of
C<$client_token> and C<$priority_class> are not C<undef>.
=cut
_txn modify_persistent_request => sub {
my ($self, $ok, $err, $global, $identifier, $client_token, $priority_class) = @_;
$self->serialise ($identifier => sub {
my ($self, $guard) = @_;
$self->send_msg (modify_persistent_request =>
global => $global ? "true" : "false",
identifier => $identifier,
defined $client_token ? (client_token => $client_token ) : (),
defined $priority_class ? (priority_class => $priority_class) : (),
);
=item $status = $fcp->client_get ($uri, $identifier, %kv)
%kv can contain (L<http://wiki.freenetproject.org/FCP2p0ClientGet>).
ignore_ds, ds_only, verbosity, max_size, max_temp_size, max_retries,
priority_class, persistence, client_token, global, return_type,
binary_blob, allowed_mime_types, filename, temp_filename
=cut
_txn client_get => sub {
1
});
});
};
=item $status = $fcp->remove_request ($identifier[, $global])
Remove the request with the given isdentifier. Returns true if successful,
false on error.
=cut
_txn remove_request => sub {
my ($self, $ok, $err, $identifier, $global) = @_;
$self->serialise ($identifier => sub {
my ($self, $guard) = @_;
$self->send_msg (remove_request =>
identifier => $identifier,
global => $global ? "true" : "false",
);
$self->on (sub {
my ($self, $type, $kv, @extra) = @_;
$guard if 0;
In addition, an event (basically a fake message) of type C<request_changed> is generated
on every change, which will be called as C<< $cb->($fcp, $kv, $type) >>, where C<$type>
is the type of the original message triggering the change,
To fill this cache with the global queue and keep it updated,
call C<watch_global> to subscribe to updates, followed by
C<list_persistent_requests_sync>.
$fcp->watch_global_sync_; # do not wait
$fcp->list_persistent_requests; # wait
To get a better idea of what is stored in the cache, here is an example of
what might be stored in C<< $fcp->{req}{"Frost-gpl.txt"} >>:
{
identifier => "Frost-gpl.txt",
uri => 'CHK@Fnx5kzdrfE,EImdzaVyEWl,AAIC--8/gpl.txt',
binary_blob => "false",
global => "true",
max_retries => -1,
max_size => 9223372036854775807,
persistence => "forever",
priority_class => 3,
real_time => "false",
started => "true",
type => "persistent_get",
verbosity => 2147483647,
sending_to_network => {
identifier => "Frost-gpl.txt",
global => "true",
},
compatibility_mode => {
identifier => "Frost-gpl.txt",
definitive => "true",
dont_compress => "false",
global => "true",
max => "COMPAT_1255",
min => "COMPAT_1255",
},
expected_hashes => {
identifier => "Frost-gpl.txt",
global => "true",
hashes => {
ed2k => "d83596f5ee3b7...",
md5 => "e0894e4a2a6...",
sha1 => "...",
sha256 => "...",
tth => "...",
},
},
expected_mime => {
identifier => "Frost-gpl.txt",
global => "true",
metadata => { content_type => "application/rar" },
},
expected_data_length => {
identifier => "Frost-gpl.txt",
data_length => 37576,
global => "true",
},
simple_progress => {
identifier => "Frost-gpl.txt",
failed => 0,
fatally_failed => 0,
finalized_total => "true",
global => "true",
last_progress => 1438639282628,
required => 372,
succeeded => 102,
total => 747,
},
data_found => {
identifier => "Frost-gpl.txt",
completion_time => 1438663354026,
data_length => 37576,
global => "true",
metadata => { content_type => "image/jpeg" },
startup_time => 1438657196167,
},
}
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
view all matches for this distribution
view release on metacpan or search on metacpan
no_index => { 'directory' => [ 'inc' ] },
name => 'AnyEvent-FIFO',
module_name => 'AnyEvent::FIFO',
script_files => [glob('script/*'), glob('bin/*')],
test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
recursive_test_files => 1,
);
if (-d 'share') {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/ServerTests.pm view on Meta::CPAN
use Moose;
use namespace::autoclean;
use 5.010;
use Path::Class qw( file dir );
use YAML qw( LoadFile DumpFile );
use File::Glob qw( bsd_glob );
with 'Dist::Zilla::Role::TestRunner';
sub test
{
inc/ServerTests.pm view on Meta::CPAN
$dir->mkpath(0,0700);
my $old = $test_root->file('t', 'lib.pl');
my $new = $dir->file('lib.pl');
symlink $old, $new;
$old = file( bsd_glob '~/etc/localhost/yml');
$new = $dir->file('config.yml');
my $config = LoadFile($old);
$config->{port} = $service;
DumpFile($new, $config);
}
my @remotes;
foreach my $remote_config (grep { $_->basename =~ /\.yml$/ } dir(bsd_glob '~/etc')->children)
{
next if $remote_config->basename eq 'localhost.yml';
#$self->zilla->log($remote_config->basename);
my $name = $remote_config->basename;
view all matches for this distribution
view release on metacpan or search on metacpan
FastPing.pm view on Meta::CPAN
call the idle callback.
The pinging process works like this: every range has a minimum interval
between sends, which is used to limit the rate at which hosts in that
range are being pinged. Distinct ranges are independent of each other,
which is why there is a per-pinger "global" minimum interval as well.
The pinger sends pings as fats as possible, while both obeying the pinger
rate limit as well as range limits.
When a range is exhausted, it is removed. When all ranges are exhausted,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/Feed.pm view on Meta::CPAN
=head2 Known Bugs
There is actually a known bug with encodings of contents of Atom feeds.
L<XML::Atom> by default gives you UTF-8 encoded data. You have to set
this global variable to be able to use the L<XML::Feed::Entry> interface
without knowledge of the underlying feed type:
$XML::Atom::ForceUnicode = 1;
I've re-reported this bug against L<XML::Feed>, as I think it should
view all matches for this distribution
view release on metacpan or search on metacpan
If you need an external module for serialisation, then you can either
pre-load it into your L<AnyEvent::Fork> process, or you can add a C<use>
or C<require> statement into the serialiser string. Or both.
Here are some examples - all of them are also available as global
variables that make them easier to use.
=over 4
=item C<$AnyEvent::Fork::RPC::STRING_SERIALISER> - octet strings only
view all matches for this distribution
view release on metacpan or search on metacpan
The path to the perl interpreter is divined using various methods - first
C<$^X> is investigated to see if the path ends with something that looks
as if it were the perl interpreter. Failing this, the module falls back to
using C<$Config::Config{perlpath}>.
The path to perl can also be overridden by setting the global variable
C<$AnyEvent::Fork::PERL> - it's value will be used for all subsequent
invocations.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent/ForkObject.pm view on Meta::CPAN
my ($self) = @_;
$self->{destroyed} = 1;
$self->{handle}->push_write("'bye'\n") if $self->{handle};
delete $self->{handle};
return if in_global_destruction;
# kill zombies
my $cw;
$cw = AE::child $self->{pid} => sub {
my ($pid, $code) = @_;
lib/AnyEvent/ForkObject.pm view on Meta::CPAN
sub DESTROY
{
# You can call DESTROY by hand
my ($self, $cb) = @_;
return if in_global_destruction;
$cb ||= sub { };
my $fo = $self->{fo};
unless (blessed $$fo) {
$cb->(fatal => 'Child process was already destroyed');
return;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AnyEvent.pm view on Meta::CPAN
These watchers are normal Perl objects with normal Perl lifetime. After
creating a watcher it will immediately "watch" for events and invoke the
callback when the event occurs (of course, only when the event model
is in control).
Note that B<callbacks must not permanently change global variables>
potentially in use by the event loop (such as C<$_> or C<$[>) and that B<<
callbacks must not C<die> >>. The former is good programming practice in
Perl and the latter stems from the fact that exception handling differs
widely between event loops.
lib/AnyEvent.pm view on Meta::CPAN
The block will be executed I<after> the actual backend has been detected
(C<$AnyEvent::MODEL> is set), so it is possible to do some initialisation
only when AnyEvent is actually initialised - see the sources of
L<AnyEvent::AIO> to see how this is used.
The most common usage is to create some global watchers, without forcing
event module detection too early. For example, L<AnyEvent::AIO> creates
and installs the global L<IO::AIO> watcher in a C<post_detect> block to
avoid autodetecting the event module at load time.
If called in scalar or list context, then it creates and returns an object
that automatically removes the callback again when it is destroyed (or
C<undef> when the hook was immediately executed). See L<AnyEvent::AIO> for
lib/AnyEvent.pm view on Meta::CPAN
$isa_hook[$i] = $pkg ? [$pkg, $reset_ae] : undef;
_isa_set;
}
# all autoloaded methods reserve the complete glob, not just the method slot.
# due to bugs in perls method cache implementation.
our @methods = qw(io timer time now now_update signal child idle condvar);
sub detect() {
return $MODEL if $MODEL; # some programs keep references to detect
lib/AnyEvent.pm view on Meta::CPAN
local $SIG{__DIE__}; # we use eval
# free some memory
*detect = sub () { $MODEL };
# undef &func doesn't correctly update the method cache. grmbl.
# so we delete the whole glob. grmbl.
# otoh, perl doesn't let me undef an active usb, but it lets me free
# a glob with an active sub. hrm. i hope it works, but perl is
# usually buggy in this department. sigh.
delete @{"AnyEvent::"}{@methods};
undef @methods;
if ($ENV{PERL_ANYEVENT_MODEL} =~ /^([a-zA-Z0-9:]+)$/) {
lib/AnyEvent.pm view on Meta::CPAN
By default, AnyEvent will log messages with loglevel C<4> (C<error>) or
higher (see L<AnyEvent::Log>). You can set this environment variable to a
numerical loglevel to make AnyEvent more (or less) talkative.
If you want to do more than just set the global logging level
you should have a look at C<PERL_ANYEVENT_LOG>, which allows much more
complex specifications.
When set to C<0> (C<off>), then no messages whatsoever will be logged with
everything else at defaults.
view all matches for this distribution