http::proxy module engine
I have a question about this CPAN module http://search.cpan.org/dist/HTTP-Proxy/
it seems that this module support engines
Could someone explain me the difference between:
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new( engine => 'NoFork' );
开发者_JAVA百科and :
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new;
and:
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new( engine => ScoreBoard );
To quote from HTTP::Proxy::Engine POD
The role of an engine is to implement the main fork+serve loop with all the required bookkeeping. This is also a good way to test various implementation and/or try out new algorithms without too much difficulties.
The descriptions of various engines are:
HTTP::Proxy::Engine::Legacy - The "older" HTTP::Proxy engine
HTTP::Proxy::Engine::NoFork - A basic, non forking HTTP::Proxy engine
HTTP::Proxy::Engine::ScoreBoard -A scoreboard-based HTTP::Proxy engine
NOTE: The last one seems to be implementing a "Scoreboard" dynamic scheduling algorithm (which is usually used for CPU instruction sceduling). In this case it's much more simplified, and the scoreboard - from my glancing at the source - appears to be simply a list of statuses of each forked off child process
精彩评论