开发者

http::proxy module engine

开发者 https://www.devze.com 2023-02-06 12:28 出处:网络
I have a question about this CPAN module http://search.cpan.org/dist/HTTP-Proxy/ it seems that this module support engines

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

0

精彩评论

暂无评论...
验证码 换一张
取 消