NAME
POE - the Perl Operating Environment
SYNOPSIS
use POE;
DESCRIPTION
In general, POE provides "kernel" services, including select(2)
, events signals, alarms and reusable boilerplates for common functions.
In specific, POE uses POE::Kernel
and POE::Session
for you.
CLASSES
POE::Kernel - main loop; select(2), signal, alarm, event services
POE::Session - state machine managed by
POE::Kernel
POE::Driver (abstract) - drive (read and write) an
IO::Handle
POE::Driver::SysRW -
sysread
andsyswrite
on anIO::Handle
POE::Filter (abstract) - bidirectional stream cooker; converts raw data to something useful (such as lines), and back
POE::Filter::Line - break input into lines; add newlines to output
POE::Wheel (abstract) - a way to extend
POE::Session
by adding or removing event handlers from state machinesPOE::Wheel::ReadWrite - manage read/write states for a session
POE::Wheel::ListenAccept - accept incoming TCP socket connections
POE::Wheel::FollowTail - watch the end of an ever-growing file
EXAMPLES
tests/followtail.perl
Starts 21 sessions, and runs them until SIGINT. 10 sessions write to dummy log files; 10 sessions follow the log tails; one session spins its wheels to make sure things are not blocking.
tests/forkbomb.perl
Starts one session whose job is to continually start copies of itself (and occasionally quit). A counter limits this test to about 150 total sessions, and the kernel will respond to SIGINT by killing everything and exiting.
This is an excellent shakedown of parent/child relationships and signals.
tests/selects.perl
Starts two sessions, and runs until SIGINT. The first session is a TCP chargen server; the second is a simple TCP client that connects to the first. The client session has a limiter that causes the session to exit after printing a few chargen lines.
POE::Wheel::ReadWrite
andPOE::Wheel::ListenAccept
were based on the code here.This was the second test, written to exercise the
select(2)
logic inPOE::Kernel
.tests/sessions.perl
Starts five sessions that loop a few times and stop. It was written to exercise the
POE::Kernel
event queue.tests/signals.perl
One session that prints out a dot every second and recognizes SIGINT.
BUGS
POE::Kernel
will exit on some signals, even if they are caught by sessions. This behavior can be evil for things that don't especially want to go away, so don't depend on it, okay? Thanks!
Signals just go to sessions in willy-nilly order. This may not be desirable, but it was quick to implement.
CONTACT AND COPYRIGHT
Copyright 1998 Rocco Caputo <troc@netrus.net>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.