App-Environ-DNS

 view release on metacpan or  search on metacpan

example/example.pl  view on Meta::CPAN


use lib 'lib';

use App::Environ;
use App::Environ::DNS;

App::Environ->send_event('initialize');

my $pid = fork();
if ($pid) {
  say 'Parent';
}
else {
  say 'Worker';
  App::Environ->send_event('postfork');
  ## Now we have correct AnyEvent::DNS and AnyEvent::DNS::Resolver
}

App::Environ->send_event('finalize:r');

lib/App/Environ/DNS.pm  view on Meta::CPAN


=head1 SYNOPSIS

  use App::Environ;
  use App::Environ::DNS;

  App::Environ->send_event('initialize');

  my $pid = fork();
  if ($pid) {
    say 'Parent';
  }
  else {
    say 'Worker';
    App::Environ->send_event('postfork');
    ## Now we have correct AnyEvent::DNS and AnyEvent::DNS::Resolver
  }

  App::Environ->send_event('finalize:r');

=head1 DESCRIPTION

App::Environ::DNS used to get fork safety to AnyEvent::DNS in App::Environ environment.



( run in 1.539 second using v1.01-cache-2.11-cpan-d7f47b0818f )