Changeset 17885

Show
Ignore:
Timestamp:
08/19/08 07:51:50 (5 years ago)
Author:
tokuhirom
Message:

- run with poe
- select interface with argv

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-Engine/trunk/tools/profile2.pl

    r17880 r17885  
    44use HTTP::Engine; 
    55use LWP::UserAgent; 
     6 
     7my $module = shift || 'ServerSimple'; 
     8print "module: $module\n"; 
     9Class::MOP::load_class("HTTP::Engine::Interface::$module"); 
    610 
    711test_tcp( 
     
    1519    server => sub { 
    1620        my $port = shift; 
    17         require Devel::NYTProf; 
    18         $ENV{NYTPROF} = 'start=no'; 
    19         Devel::NYTProf->import; 
    20         DB::enable_profile(); 
    21         $SIG{TERM} = sub { DB::_finish(); exit; }; 
     21 
     22        if (!$ENV{NO_NYTPROF}) { 
     23            require Devel::NYTProf; 
     24            $ENV{NYTPROF} = 'start=no'; 
     25            Devel::NYTProf->import; 
     26            DB::enable_profile(); 
     27            $SIG{TERM} = sub { DB::_finish(); exit; }; 
     28        } 
     29 
    2230        HTTP::Engine->new( 
    2331            interface => { 
    24                 module => 'ServerSimple', 
     32                module => $module, 
    2533                args => { 
    2634                    port => $port, 
     
    3240            }, 
    3341        )->run; 
     42        if ($module eq 'POE') { 
     43            POE::Kernel->run(); 
     44        } 
    3445    }, 
    3546);