POE-0.26 > POE

名前

POE - multitasking and networking framework for perl

POE - マルチタスク及びネットワークのperl用フレームワーク

概要

  #!/usr/bin/perl -w
  use strict;

  # POEを使う!
  use POE;

  sub handler_start {
    my ($kernel, $heap, $session) = @_[KERNEL, HEAP, SESSION];
    print "Session ", $session->ID, " has started.\n";
    $heap->{count} = 0;
    $kernel->yield('increment');
  }

  sub handler_increment {
    my ($kernel, $heap, $session) = @_[KERNEL, HEAP, SESSION];
    print "Session ", $session->ID, " counted to ", ++$heap->{count}, ".\n";
    $kernel->yield('increment') if $heap->{count} < 10;
  }

  sub handler_stop {
    print "Session ", $_[SESSION]->ID, " has stopped.\n";
  }

  for (0..9) {
    POE::Session->create(
      inline_states =>
        { _start    => \&handler_start,
          increment => \&handler_increment,
          _stop     => \&handler_stop,
        }
    );
  }

  $poe_kernel->run();
  exit;

QUICK LINKS

Please see the SEE ALSO section for conceptual summary of all POE's documentation.

POEの全ドキュメントの基本的な要約についてはSEE ALSOセクションを参照して ください。

POE's distribution comes with a directory full of examples, but they are gradually being phased out in favor of an online "cookbook". Please see the samples directory, and also look at http://poe.perl.org/?POE_Cookbook for more contemporary examples.

POEのディストリビューションにはサンプルスクリプトの詰まったディレクトリ が付属していますが、それらはオンライン"クックブック"を優先して徐々に取 り除かれていっています。samplesディレクトリを見るか、または最新のサンプ ルが http://poe.perl.org/?POE_Cookbook にあるので参照してください。

Please see http://www.perl.com/pub/2001/01/poe.html for an excellent, and more importantly: gradual, introduction to POE. If this manpage doesn't make sense, perhaps the introduction will.

優れた、より重要なことには段階的な、POEの手引きが http://www.perl.com/pub/2001/01/poe.html にあるので参照してください。も しこのmanページを読んでも理解できない場合は、おそらくこの手引きを読むと 理解できるでしょう。

Please see POE's web site at http://poe.perl.org/ for FAQs, cookbook examples, and modules using POE.

FAQ、クックブック、サンプル、POEを使用しているモジュールについてはPOEの Webサイト http://poe.perl.org/ を参照してください。

説明

POE is an acronym of "Perl Object Environment". It originally was designed as the core of a persistent object server and runtime environment, but it's evolved into a general purpose multitasking and networking framework.

POEは"Perl Object Environment"(Perlオブジェクト環境)の頭文字を取った略 語です。元々は永続オブジェクトサーバや実行時環境(ランタイム環境)の中心 として設計されましたが、汎用のマルチタスキングとネットワーキングのフレ ームワークに発展しました。

POE's core contains two types of modules. First there's POE::Kernel; this is the main resource manager and event loop. Second are the sessions or state machines which implement the actual threads. The sessions are POE::Session (not quite a proper state machine) and POE::NFA.

POEの中心は2種類のモジュールを含んでいます。一つはPOE::Kernel(カーネル) です; これはリソース(資源)の中心的な管理者とイベントループです。もう一 つはセッションまたは状態機械で、実際のスレッドを実装します。セッション はPOE::Session(完全に適切な状態機械ではありません)とPOE::NFAです。

The remainder of this distribution consists of convenience and helper modules, most of which aren't required to begin using POE.

このディストリビューションの残りは便利で手助けとなるモジュールで構成さ れており、その大部分はPOEを使い始めるのに必須ではありません。

USING POE

Using POE can be pretty tedious. Consider this example, which pulls in the necessary modules for a line-based TCP server:

POEの使用はとても退屈になりえます。行ベースのTCPサーバに必要なモジュー ルを引き出すこの例を考えてみてください。

  use POE::Kernel;
  use POE::Session;
  use POE::Wheel::SocketFactory;
  use POE::Wheel::ReadWrite;
  use POE::Filter::Line;
  use POE::Driver::SysRW;

The POE.pm module fixes some of this tedium. When POE.pm is used directly, it automatically includes POE::Kernel and POE::Session. It also includes each of the use statement's parameters, first prepending "POE::" to them. An example is in order:

POE.pmモジュールはこの退屈さをいくらか改善します。POE.pmが直接useされる と、自動的にPOE::KernelとPOE::Sessionもインクルードされます。さらに use文の各引数に対して語頭に"POE::"が付加されたものもインクルードされ ます。

This use statement is equivalent to the previous six.

このuse文は先の6つの文と等価です。

  use POE qw( Wheel::SocketFactory Wheel::ReadWrite
              Filter::Line Driver::SysRW
            );

WRITING POE PROGRAMS

Basic POE programs have four parts.

基本的なPOEプログラムには4つのパートがあります。

Preliminary program setup

プログラムの準備設定

This is the usual overhead for writing a Perl program: a shebang line, perhaps some use statements to import things, and maybe some global variables or configuration constants. It's all pretty standard stuff.

これはPerlプログラムを書くための通常のオーバーヘッドです。即ち、シェバ ング(#!)行や、おそらく何かをインポートするためのuse文、グローバル変 数や環境設定(コンフィギュレーション)用定数もあるでしょう。これは全く標 準的なことです。

  #!/usr/bin/perl -w
  use strict;
  use POE;
Define the program's event handlers or states

プログラムのイベントハンドラや状態を定義

Declare functions which will handle events here. This is deceptive, since the functions can be declared anywhere, including as anonymous subroutines in a session constructor call.

イベントを扱う関数をここで宣言してください。これは便宜的なものです。な ぜなら関数はどんなところでも、例えばセッションのコンストラクタを呼び出 している途中に無名サブルーチンとしてでも、宣言することができるからです。

  sub handler_start {
    ...
  }

  sub handler_increment {
    ...
  }

  sub handler_stop {
    ...
  }
Start initial sessions or machines

最初のセッション機械の開始

The Kernel only runs as long as there is something for it to do. It's main loop returns after the last session has stopped. The obvious corolary to this rule is that the main loop will return immediately if nothing is set up when it's called.

カーネルは何かすることがある限り動きます。そのメインループは最後のセッ ションが停止した後に戻ります。この規則での明らかな結果は、もし呼ばれた ときに何も設定されていなければ、メインループは直ちに戻るということです。

  for (0..9) {
    POE::Session->create(
      inline_states =>
        { _start    => \&handler_start,
          increment => \&handler_increment,
          _stop     => \&handler_stop,
        }
    );
  }
Start the kernel's main loop

カーネルのメインループの開始

_start handlers are invoked immediately when sessions are instantiated. Everything else happens because the kernel makes it so, and the kernel can't do that 'til it's started. Most programs exit afterwards since the kernel only returns after everything is done.

セッションがインスタンス化されると直ちに_startハンドラが呼ばれます。そ の他全てのことが起きるのはカーネルがそうするからで、またカーネルは開始 されっっるまでそれを行うことはできません。その後ほとんどのプログラムは exitしますが、それはカーネルは全てが完了した後にのみ戻るからです。

  $poe_kernel->run();
  exit 0;

POE's ARCHITECTURE

POE is built in separate layers. Each layer requires the ones beneath it, but no low-level layer requires a higher one.

POEは複数のレイヤに分けられて構築されています。各レイヤはすぐ下のものを 必要としますが、低レベルのレイヤがより高いものを必要とすることはありま せん。

Events layer

イベントレイヤ

The events layer consists of an event dispatcher, POE::Kernel, and the sessions or state machines it runs: POE::Session (a generic event driven thread) and POE::NFA (an event driven nondeterministic finite automaton).

イベントレイヤはイベントディスパッチャPOE::Kernelと、それが実行するセッ ションまたは状態機械POE::Session(汎用のイベントドリブンのスレッド)と POE::NFA(イベントドリブンの非決定性有限オートマトン)で構成されています。

One or more I/O layers

1つ以上のI/Oレイヤ

I/O layers are built upon the event layer, and that allows them to coexist in the same program. POE only includes one I/O layer: Wheels. "Wheels" is a whimsical name for interlocking cogs that together make things go. They're also reinvented a lot, and this is no exception.

I/Oレイヤはイベントレイヤの上に構築されており、そのおかげで同じプログラ ムの中でそれらが共存することができます。POEにはホイール(wheel)というた だ1つだけのI/Oレイヤが収録されています。"ホイール"とは、歯車の歯と組合 わさって共に物事を動くようにするという意味の一風変わった名前です。また それらは何度も再発明されますが、これも例外ではありません。

POE comes with six wheels.

POEには6つのホイールが付属しています。

POE::Wheel::Curses

The Curses wheel handles non-blocking input for programs using the curses text interface. It requires the Curses perl module and a familiarity with curses programming.q

Cursesホイールはcursesテキストインターフェースをしようしているプログラ ム用にノンブロッキングの入力を扱います。これが必要とするものはPerlモジ ュールのCursesとcursesプログラミングに精通していることです。

POE::Wheel::FollowTail

FollowTail follows the tail of an ever-growing file. It's useful for watching logs and things of that nature.

FollowTailは絶えず大きくなっていくファイルの最後尾を追います。これはロ グやそのような性質を持つものを見張るのに役立ちます。

POE::Wheel::ListenAccept

ListenAccept performs ye olde non-blocking socket listen and accept. It's great for programs that can't use SocketFactory and instead must listen and accept connections from sockets created elsewhere.

ListenAcceptは古めかしいノンブロッキングのソケットのlistenとacceptを行 います。これは、SocketFactoryは使用できないが他の場所で生成されたソケッ トからの接続をlistenしacceptしなければならないプログラムにとって役立ち ます。

POE::Wheel::ReadLine

The ReadLine wheel accepts console input as lines only. It handles many of the common shell command editing keystrokes, making it pretty easy to input things. It's event driven, unlike Term::ReadLine, and it cooperates nicely with the rest of POE.

ReadLineホイールは行単位のコンソールからの入力のみを受け付けます。これ は基本的なシェルコマンドの編集キーの多くを扱い、入力することをとても簡 単にします。これはTerm::ReadLineと違ってイベントドリブンなので、POEの他 の部分とうまく協調します。

POE::Wheel::ReadWrite

ReadWrite is the star of POE's default I/O layer. It performs buffered, flow-controlled I/O on non-blocking, unbuffered filehandles. It almost acts like a Unix stream which can't stack protocol layers, but that may change.

ReadWriteはPOEのデフォルトのI/Oレイヤの花形です。これはノンブロッキング でバッファのないファイルハンドル上でバッファのあるフロー制御されたI/Oを 行います。ほとんどプロトコル層を積み重ねることができないUnixストリーム のように振る舞いますが、これは変更されるかもしれません。

ReadWrite uses two other classes to do its dirty work: Driver and Filter. Drivers do the actual work of reading and writing filehandles. Filters translate between raw streams and cooked chunks of tasty dada.

ReadWriteは泥臭い仕事を行うために他に2つのクラスDriver(ドライバ)と Filter(フィルタ)を使用します。ドライバはファイルハンドルを読んだり書い たりする実際の仕事を行います。フィルタは生のストリームと風味のある調理 されたチャンク(chunk)との間の変換を行います。

D comes before F, so Drivers go first.

Fより先にDが来るので、ドライバを先に紹介します。

POE::Driver::SysRW

Nobody has needed another driver yet, so this is the only one currently available. It performs sysread and syswrite in a generic way so that ReadWrite can use it and future drivers interchangeably.

誰も他のフィルタを必要としていないので、現在利用できるのはこれ一つです。 これはsysreadとsyswriteを一般的な方法で行うので、ReadWriteはこれと将来 のドライバを交換して使用することができます。

Other drivers will use the same interface, should they ever be written.

もし他のドライバが書かれるべきであれば、それらは同じインターフェースを 利用するでしょう。

Filters next. There are a few.

次にフィルタを紹介します。これはいくつかあります。

POE::Filter::Block

This filter parses input as fixed-length blocks. On the output side, it merely passes data through unscathed.

このフィルタは入力を固定長のブロックとしてパースします。出力側では、単 にデータを無傷のまま渡します。

POE::Filter::HTTPD

The HTTPD filter parses input as HTTP requests and translates them into HTTP::Request objects. On the output side, it takes HTTP::Response objects and turns them into something suitable to be sent to a web client/user-agent.

HTTPDフィルタは入力をHTTPリクエストとしてパースし、それらをHTTP:: Requestオブジェクトに変換します。出力側では、HTTP::Responseオブジェクト を受け取ってそれらをwebクライアント/ユーザエージェントに送るのに適した ものに変換します。

POE::Filter::Line

The Line filter parses incoming streams into lines and turns outgoing lines into streams. It used to be very basic, but recent improvements have added interesting features like newline autodetection.

Lineフィルタは入力ストリームを行単位にパースし、行単位の出力をストリー ムに変換します。以前は非常に基礎的なものでしたが、最近の改良によって改 行の自動検出のような興味深い機能が追加されました。

POE::Filter::Reference

The Reference filter is used to send Perl structures between POE programs or between POE and other Perl programs. On the input side, frozen data (via Storable, FreezeThaw, YAML, or some other data mechanism) is thawed into Perl data structures. On output, references given to the filter are frozen. Data may also be compressed on request if Compress::Zlib is installed.

ReferenceフィルタはPOEプログラム間またはPOEと他のPerlプログラム間でPerl の構造体を渡すために使用されます。入力側では、(Storable、FreezeThaw、 YAML、あるいは他のデータメカニズムによって)冷凍(freeze)されたデータが Perlの構造体に解凍(thaw)されます。出力側では、フィルタに渡されたリファ レンスが冷凍されます。またCompress::Zlibがインストールされていれば、要 求次第でデータを圧縮することもできます。

POE::Filter::Stream

The stream filter does nothing. It merely passes data through without any change.

Streamフィルタは何も行いません。単にデータを何の変更もなしに渡します。

POE::Wheel::Run

The Run wheel provides a way to run functions or other programs in child processes. It encapsulates the necessary pipe() and fork() code, and sometimes exec(). Internally, it handles reading from and writing to child processes without further intervention. Child output arrives in the Wheel's owner as events.

Runホイールは関数や他のプログラムを子プロセスで動かす方法を提供します。 これは必要なpipe()、fork()、時にはexec()をカプセル化します。内部的には、 子プロセスへの読み込みと書き込みをそれ以上の干渉なしに扱います。子プロ セスの出力はそのホイールの所有者にイベントとして届きます。

POE::Wheel::SocketFactory

SocketFactory creates all manner of connectionless and connected network sockets. It also listens on TCP server sockets, only returning accepted client connections as they arrive.

SocketFactoryはあらゆる種類のコネクション型およびコネクションレス型のネ ットワークソケットを生成します。またTCPサーバソケットをlistenし、accept されたクライアントのコネクションをそれらが到着したときにのみ返します。

POE COMPONENTS

Components consist of one or more sessions or state machines that encapsulate a very high level procedure. For example, POE::Component::IRC (not included) performs nearly all the functions of a full-featured IRC client. POE::Component::UserBase (not included) is a user authentication and data persistence servlet.

コンポーネント(component)は非常に高水準の手続きをカプセル化する1つ以上 のセッションまたは状態機械から構成されます。例えば、POE::Component::IRC (未収録)は完全な機能を備えたIRCクライアントのほとんど全ての機能を果たし ます。POE::Component::UserBase(未収録)はユーザ認証とデータ永続化のサー ブレットです。

Components tend to be highly reusable libraries that handle tedious tasks, freeing programmers to focus on more interesting things. This should be true for any library, though.

コンポーネントは再利用性が高いライブラリである傾向があり、退屈な仕事を 扱ってプログラマがより興味のあることに集中できるようにします。このこと はどんなライブラリについても正しいべきですが。

A list of released POE::Component modules is at: http://search.cpan.org/search?mode=module&query=POE%3A%3AComponent

リリース済みのPOE::Componentモジュールの一覧は http://search.cpan.org/search?mode=module&query=POE%3A%3AComponent にあ ります。

POE::Component::Client::TCP

The Client::TCP component provides the most common core features for writing TCP clients.

Client::TCPコンポーネントはTCPクライアントを書くための最も基本的で核と なる機能を提供します。

POE::Component::Server::TCP

The Server::TCP component provides the most common core features for writing TCP servers. A simple echo server is about 20 lines.

Server::TCPコンポーネントはTCPサーバを書くための最も基本的で核となる機 能を提供します。単純なechoサーバはおよそ20行です。

Support Modules

Finally, there are some files which POE uses but aren't required elsewhere. These include POE::Preprocessor and the base classes: POE::Component, POE::Driver, POE::Filter and POE::Wheel. There also are some development files in the lib directory.

最後に、POEは使用するけれど他では必要とされないファイルがあります。それ らにはPOE::Preprocessorと基底クラスPOE::Component、POE::Driver、POE:: Filter、POE::Wheelが含まれます。また、libディレクトリには開発ファイルも あります。

POE::Preprocessor

This is a macro preprocessor. It also implements plain and enumerated constants. POE::Kernel uses it to inline smaller functions and make the source generally more readable. There seem to be two drawbacks: First, code is more difficult to examine in perl's debugger since it doesn't necessarily look like the original source. Second, programs take longer to start up because every source line must first pass through a perl filter. The compile-time penalty is negligible in long-running programs, and the runtime boost from fewer function calls can make up for it over time.

これはマクロのプリプロセッサです。また通常の定数や列挙型の定数も実装し ます。小さい関数をインラインに記述してソースを一般的により読みやすくす るためにPOE::Kernelが使用します。欠点が2つあるようです。一つは、コード が本来のソースのように見える必要がないのでperlのデバッガで検査するのが より難しくなることです。もう一つは、ソースの全ての行が最初にperlのフィ ルタを通過しなければならないので、プログラムの開始に時間が多くかかるこ とです。コンパイル時の損失は長時間動作するプログラムでは無視できるもの であり、より少なくなる関数呼び出しによる実行時の後押しは時間が経てば損 失を補うことができます。

POE::Component, POE::Driver and POE::Filter exist to document their classes of objects. POE::Wheel contains some base functions for tracking unique wheel IDs.

POE::Component、POE::Driver、POE::Filterは自身のオブジェクトのクラスを ドキュメント化するために存在しています。POE::Wheelは一意的なホイールID をトラッキングするための基本的な関数をいくつか含んでいます。

SAMPLE PROGRAMS

This distribution contains several example and/or tutorial programs in the ./samples directory. Be advised, however, that they are old and may not exhibit the most current coding practices.

このディストリビューションはいくつかのサンプルやチュートリアルプログラ ムを./samplesディレクトリ内に含んでいます。しかしながら、それらは古く、 現在のほとんどのコーディングの慣習を示していないかもしれないことに注意 してください。

The sample programs are scheduled for removal from this distribution in version 0.1301. They are being moved to the web version of the POE Cookbook, which is available at <http://poe.perl.org/?POE_Cookbook>.

サンプルプログラムはバージョン0.1301でこのディストリビューションから取 り除かれる予定です。それらはweb版のPOEクックブックに移動させられており、 http://poe.perl.org/?POE_Cookbook で入手可能です。

The author is always looking for new example ideas.

作者は常にサンプルスクリプトの新アイデアを探しています。

COMPATIBILITY ISSUES

POE has tested favorably on as many Perl versions as the author can find or harass people into trying. This includes Linux, FreeBSD, OS/2 and at least one unspecified version of Windows. As far as anyone can tell, nobody ever has tried it on any version of MacOS.

POEは作者が見つけるか人々に試すようにけしかけるかできる限りのバージョン のPerlで順調にテストされました。これはLinux、FreeBSD、OS/2、少なくとも1 つの未特定のバージョンのWindowsを含みます。一般に知られている限りでは、 これまでにMacOSのいずれかのバージョンを試した人はいません。

POE has been tested with Perl versions as far back as 5.004_03 and as recent as 5.7.2. The CPAN testers are a wonderful bunch of people who have dedicated resources to running new modules on a variety of platforms. The latest POE tests are visible at <http://testers.cpan.org/search?request=dist&dist=POE>. Thanks, people!

POEは古いものでは5.004_03から新しいものでは5.7.2までのバージョンのPerl でテストされました。CPANテスターは各種プラットフォームで新しいモジュー ルを動かすことに資源を捧げる素晴らしい人たちです。最新のPOEのテストは http://testers.cpan.org/search?request=dist&dist=POE で見ることができま す。皆さんに感謝します。

Please let the author know of breakage or success that hasn't been covered already. Thanks!

まだ調査対象となっていない成功や故障について作者に知らせてください。あ りがとうございます。

Specific issues:

特有の問題は以下の通りです。

Various Unices

各種UNIX

No known problems.

知られている問題はありません。

OS/2

No known problems. POE has no OS/2 tester starting with version 0.1206.

知られている問題はありません。バージョン0.1206以降のOS/2テスターはいま せん。

Windows

POE seems to work very nicely with Perl compiled for CygWin. If you must use ActiveState Perl, please use build 631 or newer.

POEはCygWin用にコンパイルされたPerlではとてもよく動くようです。もし ActiveState Perlを使用しなければならないなら、build 631以降を使用してく ださい。

Currently there is nobody maintaining POE for Windows. Rocco will be fixing things as he's able, but he has only limited access to Windows machines for testing and development. If you would like to accelerate POE's Windows support, please contact Rocco or the mailing list.

現在Windows用にPOEをメンテナンスしている者はいません。Roccoは可能な限り 修正を行いますが、彼がテストや開発のためにWindowsマシンを利用できるのは 限られたものでしかありません。もしPOEのWindowsサポートを加速させたいと 思うなら、Roccoかメーリングリストに連絡を取ってください。

Thanks to Sean Puckett, Douglas Couch, Hachi, and Dynweb for their help in bringing POE's Windows support so far.

今までにPOEのWindowsサポートを手助けしてくれたSean Puckett、Douglas Couch、Hachi、Dynwebに感謝します。

MacOS

POE 0.18 passes all tests on MacOS/X.

POE 0.18はMacOS/X上で全てのテストをパスしています。

Its pre-X support seems like a lost cause unless someone steps forward to make it happen.

X以前のサポートは誰かがやろうと名乗り出ない限り見込みがなさそうです。

SYSTEM REQUIREMENTS

POE requires Filter::Util::Call version 1.18 or newer. All the other modules are optional.

POEはFilter::Util::Callのバージョン1.18以降を必要とします。他のモジュー ルは全てオプショナルです。

Time::HiRes is recommended.

Time::HiResは推奨です。

Some of POE's sample programs use fork(). They won't work wherever fork() isn't available; sorry.

POEのサンプルプログラムにはfork()を使用するものがあります。それらは fork()が利用できないところでは動かないでしょう。申し訳ありません。

POE relies heavily on constants in the POSIX module. Some of the constants aren't defined on some platforms. POE works around this as best it can.

POEはPOSIXモジュールの定数に大きく頼っています。プラットフォームによっ ては定義されない定数もあります。このことについてPOEは可能な限り上手く働 きます。

Some of POE's sample programs require a recent IO bundle, but you get that for free with recent versions of Perl.

POEのサンプルプログラムには最近のIOバンドルを必要とするものがありますが、 それは最近のバージョンのPerlとともに無料で入手可能です。

If you want to use Filter::Reference to serialize data for transporting over a network, you will need Storable, FreezeThaw, or some other freezer/thawer package installed. If you want your data to be shipped compressed, you will also need Compress::Zlib.

もしデータを直列化してネットワーク越しにデータを転送するために Filter::Referenceを使用したい場合、Storable、FreezeThaw、または何らかの 他の冷凍/解凍用パッケージがインストールされている必要があります。もしデ ータを圧縮して転送したい場合は、Compress::Zlibも必要になるでしょう。

Important Filter::Reference note: If you're using Filter::Reference to pass data to another machine, make sure every machine has the same versions of the same libraries. Subtle differences, even in different versions of modules like Storable, can cause mysterious errors when data is reconstituted at the receiving end. When all else fails, upgrade to the latest versions.

Filter::Referenceについての重要な注意: もしFilter::Referenceを使用し て他のマシンにデータを渡そうとしているなら、全てのマシンが同じライブラ リの同じバージョンを持っていることを確認してください。Storableのような モジュールのバージョンが異なるという状況でさえ、微妙な違いは受信側でデ ータが再構成されるさいに謎めいたエラーを起こしかねません。もし何もかも が失敗するなら、最新のバージョンにアップグレードしてください。

Filter::HTTPD uses a small world of modules including HTTP::Status; HTTP::Request; HTTP::Date and URI::URL. The httpd.perl sample program uses Filter::HTTPD, which uses all that other stuff. If you want to write web servers, you'll need to install libwww-perl, which requires libnet.

Filter::HTTPDはHTTP::Status、HTTP::Request、HTTP::Date、URI::URLを含む 小さな分野のモジュールを使用します。サンプルプログラムのhttpd.perlは Filter::HTTPDを使用しますが、それら他のものも全て使用することになります。 もしwebサーバを書きたい場合はlibwww-perlをインストールする必要がありま すが、それはlibnetを必要とします。

Wheel::Curses requires the Curses module, which in turn requires some sort of curses library.

Wheel::CursesはCursesモジュールを必要としますが、それもまた何らかの cursesのライブラリを必要とします。

SUPPORT RESOURCES

These are Internet resources where you may find more information about POE.

これらはPOEについてより多くの情報を得られると思われるインターネット上の リソースです。

The POE Mailing List

POEメーリングリスト

POE has a mailing list at perl.org. You can receive subscription information by sending e-mail:

POEのメーリングリストがperl.orgにあります。以下のEメールを送ると参加に ついての情報を受け取ることができます。

  To: poe-help@perl.org
  Subject: (anything will do)

  The message body is ignored.

  To: poe-help@perl.org
  Subject: (何でも構いません)

  メッセージ本体は無視されます。

All forms of feedback are welcome.

どのような形でのフィードバックも歓迎します。

The POE Web Site

POEのWebサイト

POE has a web site where the latest development snapshot, along with the Changes file and other stuff may be found: http://poe.perl.org/

POEには最新の開発スナップショットやChangesファイル、その他の様々なもの があるwebサイトがあります。 http://poe.perl.org/

SourceForge

POE's development has moved to SourceForge as an experiment in project management. You can reach POE's project summary page at http://sourceforge.net/projects/poe/

POEの開発はプロジェクトマネージメントの実験としてSourceForgeに移動しま した。POEのプロジェクトのサマリページが以下にあります。 http://sourceforge.net/projects/poe/

SEE ALSO

This is a summary of POE's modules and the things documented in each.

これはPOEのモジュールと個別にドキュメント化されてる文書の要約です。

Events Layer

イベントレイヤ

These are POE's core modules.

これらはPOEの中心的なモジュールです。

POE (this document)

POE (このドキュメント)

The POE manpage includes a sample program and walkthrough of its parts, a summary of the modules which comprise this distribution, POE's general system requirements, how to use POE (literally), and where to get help. It also has a table of contents which you're even now reading.

POEのmanページはサンプルプログラムを一つとその各部分の概観、このディス トリビューションを構成するモジュールの要約、POEの一般的なシステム要件、 どのようにuse POEするか(文字通り)、どこで助けを得るかということを含んで います。また、あなたがちょうど今読んでいる目録もあります。

POE::Kernel

The POE::Kernel manpage includes information about debugging traces and assertions; FIFO events; filehandle watchers; Kernel data accessors; posting events from traditional callbacks (postbacks); redefining sessions' states; resource management; session aliases; signal types, handlers, and pitfalls; signal watchers; synchronous vs. asynchronous events; and timed events (alarms and delays).

POE::Kernelのmanページはデバッグ用のトレースとアサーション; FIFOイベン ト; ファイルハンドルウォッチャ; Kernelデータアクセサ; 伝統的なコールバ ック(ポストバック)からのイベントの通知; セッション状態の再定義、リソー スマネージメント; セッションエイリアス; シグナルのタイプ、ハンドラ、落 とし穴; シグナルウォッチャ; 同期イベントvs非同期イベント; 指定時刻に動 作するイベント(アラームとディレイ)についての情報を含んでいます。

POE::NFA

The POE::NFA manpage covers this session's additional predefined events, how NFA differs from Session, state changing methods, and the spawn constructor.

POE::NFAのmanページはこのセッションの追加的なあらかじめ定義されているイ ベント、NFAはSessionとどう違うのか、状態変更メソッド、spawn constructor をカバーします。

POE::Session

The POE::Session manpage covers different kinds of states (inline coderef, object methods, and package methods); postback mechanics; predefined event names and the parameters included with them; resource management and its effects on sessions; session constructors (new and create); session data accessors; synchronous vs. asynchronous events in more detail; why sessions don't stop by themselves, and how to force them to.

POE::Sessionのmanページは各種の状態(inline codered、オブジェクトメソッ ド、パッケージメソッド); ポストバック機構、あらかじめ定義されているイベ ント名とそれらに含まれるパラメータ; リソースマネージメントとSessionに対 するその効果; セッションのコンストラクタ(newとcreate); セッションデータ アクセサ; 同期イベントvs非同期イベントについての詳細; なぜセッションは 自分自身で止まらないのか、そして止まるように強制する方法をカバーします。

I/O Layer

I/Oレイヤ

These modules comprise POE's default I/O abstraction.

これらのモジュールはPOEの標準のI/Oアブストラクションを構成します。

POE::Driver

The POE::Driver manpage covers drivers in general and their common interface.

POE::Driverのmanページはドライバを全般的にカバーし、またそれらの共通の インターフェースを説明します。

POE::Driver::SysRW

The SysRW driver's manpage describes the sysread/syswrite abstraction and covers parameters which can be used to customize a SysRW driver's operation.

SysRWドライバのmanページはsysread/syswriteアブストラクションを説明し、 SysRWドライバの動作をカスタマイズするために使うことができるパラメータを カバーします。

POE::Filter

The POE::Filter manpage covers filters in general and their common interface. It discusses the pitfalls involved in switching filters on a running wheel.

POE::Filterのmanページはフィルタを全般的にカバーし、またそれらの共通の インターフェースを説明します。動作中のホイールでフィルタを交換するとき に生じる落とし穴について論じます。

POE::Filter::Grep

Grep is part of the family of filters that includes Stackable, Map, and RecordBlock. It applies a regexp filter on data passing through it, before it reaches a Session. It's mainly used in filter stacks (see POE::Filter::Stackable).

Grepは、Stackable、Map、RecordBlockを含むフィルタのファミリの一部です。 これはデータがSessionに届く前にGrepフィルタを通過するときに正規表現フィ ルタを適用します。これは主にフィルタのスタックで使われます (POE::Filter::Stackableを参照してください)。

POE::Filter::HTTPD

The HTTPD filter's manpage covers using POE as a web server.

HTTPDフィルタのmanページはPOEをwebサーバとして使うことをカバーします。

POE::Filter::Line

The Line filter's manpage discusses how to read and write data by lines; how to change the newline literal or regular expression; and how to enable newline autodetection when working with strange peers.

Lineフィルタのmanページは行単位でどのようにデータを読み書きするか; 改行 文字や正規表現を変更する方法; 見知らぬ相手と連携するときに改行の自動検 出をどのように有効にするかということを論じます。

POE::Filter::Map

Map is part of the family of filters that includes Stackable, Grep, and RecordBlock. It transforms data passing through it, before it reaches a Session.

Mapは、Stackable、Grep、RecordBlockを含むフィルタのファミリの一部です。 これはデータがSessionに届く前にMapフィルタを通過するときにデータを変換 します。

The Map filter is designed primarily to act as an interface between filters that deal with different data formats, but it can be used stand-alone to perform unique functions that no other filter does. In this case it's something of a wildcard filter.

元々Mapフィルタは異なったデータフォーマットに対処するフィルタ間のインタ ーフェースとして動くように設計されましたが、他のフィルタが行わない一意 的な機能を実行するために単独で使うことができます。その場合ちょっとした ワイルドカードフィルタになります。

If you find yourself reusing the same custom Map filter, you may want to turn it into a full-fledged filter.

もし同じカスタムMapフィルタを再使用していることに気が付いた場合、それを 独立した本格的なフィルタに変更したいと思うでしょう。

POE::Filter::RecordBlock

RecordBlock combines records into groups by count and flattens groups of records back into a record stream. For example, RecordBlock might combine log records into pairs.

RecordBlockはレコードをカウントしてグループに結合し、レコードのグループ を平坦化してレコードのストリームに戻します。例えば、RecordBlockはログの レコードを結合して対にすることができます。

POE::Filter::Reference

The Reference filter's manpage talks about marshalling data and passing it between POE programs; and customizing the way data is frozen, thawed and optionally compressed.

ReferenceフィルタのmanページはデータのマーシャリングとPOEプログラム間で の転送; データが冷凍、解凍、オプショナルでの圧縮される方法のカスタマイ ズについて説明します。

POE::Filter::Stackable

Stackable is a meta-filter designed to stack other filters. Stackable manages the filters it contains and passes data between them. In essence, the inner filters are combined into one super filter.

Stackableは他のフィルタをスタックするために設計されたメタフィルターです。 Stackableは収容しているフィルタを管理しデータをそれらの間で渡します。本 質的には、内部フィルタは一つのスーパーフィルタに合成されます。

The Map filter can also be used to perform quick and dirty functions that aren't implemented in any single existing filter.

Mapフィルタは既存のフィルタ単体で実装されていない即席の汚い機能を実行す るためにも使うことができます。

POE::Filter::Stream

The Stream filter's manpage is pretty empty since it doesn't do much of anything.

Streamフィルタは大したことは何も行わないのでそのmanページはほとんど空で す。

POE::Wheel

The Wheel's manpage talks about wheels in general and their common interface.

Wheelのmanページはホイールを全般的にカバーし、またそれらの共通のインタ ーフェースを説明します。

POE::Wheel::FollowTail

The FollowTail wheel's manpage discusses how to watch the end of an ever-growing file (not to be confused with that orb tune) and how to change aspects of the wheel's behavior with constructor parameters.

FollowTailホイールのmanページは絶えず大きくなっていくファイルの最後を監 視する方法やコンストラクタのパラメータによってホイールの動作の様子を変 更する方法について論じます。

POE::Wheel::ListenAccept

The ListenAccept wheel's manpage discusses how to listen and accept connections using sockets created from sources other than SocketFactory.

ListenAcceptホイールのmanページはSocketFactory以外の場所で生成されたソ ケットを使用したコネクションをlistenしacceptする方法について論じます。

POE::Wheel::ReadWrite

The ReadWrite wheel's manpage covers non-blocking I/O with optional flow control.

ReadWriteホイールのmanページはオプショナルでフロー制御の付いたノンブロ ッキングI/Oをカバーします。

POE::Wheel::SocketFactory

The SocketFactory wheel's manpage discusses how socket factories create and manage sockets; the events they emit on connection, acceptance, and failure; and the parameters which govern what they do.

SocketFactoryホイールのmanページはソケットファクトリがどのようにソケッ トを生成し管理するか; それらが接続時、accept時、失敗時に発行するイベン ト; それらが何をするかを決定するパラメータについて論じます。

Standard Components

標準コンポーネント

These components are included with POE because they're nearly universally useful.

これらのコンポーネントはほぼ普遍的に役立つのでPOEに収録されています。

POE::Component

The POE::Component manpage discusses what components are and why they exist.

POE::Componentのmanページはコンポーネントとは何かということや、それらが なぜ存在するのかということについて論じます。

POE::Component::Client::TCP

The TCP client component explains how to create TCP clients quickly and easily.

TCPクライアントコンポーネントはTCPクライアントを素早く簡単に作成する方 法を説明します。

POE::Component::Server::TCP

The TCP server component explains how to create TCP servers with a minimum of fuss.

TCPサーバコンポーネントはTCPサーバを最小限の手間で作成する方法を説明し ます。

Supporting Cast

These modules help in the background.

これらのモジュールは裏方で支援しています。

POE::Pipe::OneWay

This creates unbuffered one-way pipes. It tries various methods in the hope that one of them will work on any given platform.

これはバッファのない片方向のパイプを生成します。これはどんな与えられた プラットフォーム上でもどれか一つが動くことを期待して様々な方法を試しま す。

POE::Pipe::TwoWay

This creates unbuffered two-way pipes. It tries various methods in the hope that one of them will work on any given platform. It's preferred over two OneWay pipes because sometimes two-way transports are available and it can save you a couple filehandles.

これはバッファのない双方向のパイプを生成します。これはどんな与えられた プラットフォーム上でもどれか一つが動くことを期待して様々な方法を試しま す。双方向転送はたまには利用可能でファイルハンドルをいくらか節約するこ とができるので、これは2つのOneWayパイプよりも好ましいことです。

POE::Preprocessor

POE's preprocessor covers inline constant replacement, enumerated constants, and macro substitutions in perl programs.

POEのプリプロセッサはperlプログラムでインラインの定数置換、列挙型定数、 マクロ置換をカバーします。

バグ

The t/*.t tests only cover about 70% of POE. The latest numbers are on POE's web site.

t/*.tテストはPOEのおよそ70%しかカバーしません。最新のテストはPOEのwebサ イトにあります。

AUTHORS & COPYRIGHT

POE is the combined effort of several people. If someone is missing from this list, please let Rocco know.

POEは複数の人が協力して尽力した産物です。もしこのリストに見落とされてい る人がいればRoccoに知らせてください。

Ann Barcomb

Ann Barcomb is <kudra@domaintje.com>, aka kudra. Ann contributed large portions of POE::Simple and the code that became the ReadWrite support in POE::Component::Server::TCP. Her ideas also inspired Client::TCP component, introduced in version 0.1702.

Artur Bergman

Artur Bergman is <artur@vogon-solutions.com>. He contributed many hours' work into POE and quite a lot of ideas. Years later, I decide he's right and actually implement them.

Artur is the author of Filter::HTTPD and Filter::Reference, as well as bits and pieces throughout POE. His intangible contributions include feedback, testing, conceptual planning and inspiration. POE would never have come this far without his support.

Artur is investing his time heavily into perl 5's ithreads at the moment. This project has far-reaching implications for POE's future.

Jos Boumans

Jos Boumans is <boumans@frg.eur.nl>, aka Co-Kane. Jos is a major driving force behind the POE::Simple movement and is one of the POE idea fairies. Jos is working with Ann on POE::Simple.

Matt Cashner

Matt Cashner is <eek@eekeek.org>, aka sungo. Matt is a POE ambassador, or something, between Rocco's point of view and people who haven't had the benefit of knowing the system since its conception. He's spearheaded the movement to smiplify POE for new users, flattening the learning curve and making the system more accessible to everyone. He's almost singlehandedly rewriting POE's documentation. He uses the system in mission critical applications, folding feedback and features back into the distribution for everyone's enjoyment.

Andrew Chen

Andrew Chen is <achen-poe@micropixel.com>. Andrew is the resident POE/Windows guru. He contributes much needed testing for Solaris on the SPARC and Windows on various Intel platforms.

Douglas Couch

Douglas Couch is <dscouch@purdue.edu>. Douglas maintains POE's PPD for Windows as well as up-to-date online documentation at http://poe.sourceforge.net/

Jeffrey Goff

Jeffrey Goff is <jgoff@blackboard.com>. Jeffrey is the author of several POE modules, including a tokenizing filter and a component for managing user information, PoCo::UserBase. He's also co-author of "A Beginner's Introduction to POE" at www.perl.com.

Philip Gwyn

Philip Gwyn is <gwynp@artware.qc.ca>. He extended the Wheels I/O abstraction to support hot-swappable filters, and he eventually convinced Rocco that unique session and kernel IDs were a good thing.

Philip also enhanced Filter::Reference to support different serialization methods. His intangible contributions include the discovery and/or destruction of several bugs (see the Changes file) and a thorough code review around version 0.06.

Arnar M. Hrafnkelsson

Arnar is <addi@umich.edu>. Addi tested POE and POE::Component::IRC on Windows, finding bugs and testing fixes. He appears throughout the Changes file.

Dave Paris

Dave Paris is <dparis@w3works.com>. Dave tested and benchmarked POE around version 0.05, discovering some subtle (and not so subtle) timing problems. The pre-forking server sample was his idea. Versions 0.06 and later should scale to higher loads because of his work. He has contributed a lot of testing and feedback, much of which is tagged in the Changes file as a-mused.

And I do mean *lots* of testing. I go and announce a new development version, and he's, like, "All tests passed!" just a few minutes later. If that wasn't enough, he investigates any bugs that turn up, and often fixes them. The man's scarily good.

Dieter Pearcey

Dieter Pearcey is <dieter@bullfrog.perlhacker.org>. He goes by several Japanese nicknames. Dieter's current area of expertise is in Wheels and Filters. He greatly improved Wheel::FollowTail, and his Filter contributions include the basic Block filter, as well as Stackable, RecordBlock, Grep and Map.

Robert Seifer

Robert Seifer is <e-mail unknown>. He rotates IRC nicknames regularly.

Robert contributed entirely too much time, both his own and his computers, towards the detection and eradication of a memory corruption bug that POE tickled in earlier Perl versions. In the end, his work produced a simple compile-time hack that worked around a problem relating to anonymous subs, scope and @{} processing.

Matt Sergeant

Matt contributed POE::Kernel::Poll, a more efficient way to watch multiple files than select().

Richard Soderberg

Richard Soderberg is <poe@crystalflame.net>, aka coral. Richard is a collaborator on several side projects involving POE. His work provides valuable testing and feedback from a user's point of view.

Dennis Taylor

Dennis Taylor is <dennis@funkplanet.com>. Dennis has been testing, debugging and patching bits here and there, such as Filter::Line which he improved by leaps in 0.1102. He's also the author of POE::Component::IRC.

Others?

他には?

Please contact the author if you've been forgotten.

もし忘れられていれば作者に連絡を取ってください。

Author

Rocco Caputo

Rocco Caputo is <rcaputo@cpan.org>. POE is his brainchild.

Except where otherwise noted, POE is Copyright 1998-2002 Rocco Caputo. All rights reserved. POE is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

Thank you for reading!

読んでいただいてありがとうございます!

Translators

井上 謙次 <deq@oct.zaq.ne.jp>