我有一个关于这个 CPAN 模块的问题 http://search.cpan.org/dist/HTTP-Proxy/
看来这个模块支持引擎
谁能给我解释一下:
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new( engine => 'NoFork' );
和:
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new;
和:
use HTTP::Proxy;
my $proxy = HTTP::Proxy->new( engine => ScoreBoard );
最佳答案
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.
各种引擎的说明是:
HTTP::Proxy::Engine::Legacy - “旧的”HTTP::Proxy 引擎
HTTP::Proxy::Engine::NoFork - 一个基本的、非 fork 的 HTTP::Proxy 引擎
HTTP::Proxy::Engine::ScoreBoard - 基于记分牌的 HTTP::Proxy 引擎
注意:最后一个似乎是在实现“记分牌”动态调度算法(通常用于 CPU 指令调度)。在这种情况下,它要简单得多,记分牌——从我对源代码的浏览来看——似乎只是每个 fork 子进程的状态列表
关于perl - http::proxy 模块引擎,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4797005/