perl - http::proxy 模块引擎

标签 perl http cpan

我有一个关于这个 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 );

最佳答案

引自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.

各种引擎的说明是:

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/

相关文章:

perl - Perl 有哪些代码覆盖工具?

perl - Mojolicious 家庭测试问题

arrays - 在 Perl 中向下创建整数数组

perl - 如何在Perl中设置环境变量?

javascript - Appcelerator Titanium 上传到谷歌驱动器 - Javascript 中的 Rest API - 错误 404

http - 将 Flume JSONHandler 主体作为 JSONObject 发送

perl - 在 windows xp 上安装 ffmpeg(perl 包)

perl - 在列表上下文中分配散列时有什么区别?

javascript - HTTP 请求方法和 AJAX。到底是怎么回事?

perl - "make test"在 Perl 中更详细