[tpm] Event loop, redux
lanas
lanas at securenet.net
Wed Jun 25 18:33:04 PDT 2008
Le Vendredi, 13 Juin 2008 09:05:48 -0400,
"David Golden" <xdaveg at gmail.com> a écrit :
> I haven't jumped into POE myself, but in trying to decide if/when I
> should, I did find this tutorial:
I've used POE for a few things, from plain TCP connections to serial
port comms and ncurses, to watching files and various utilities.
Although I've used curses, there are WxWidgets and GTK event
loops. And there's one that the author of the Prima toolkit (GUI all
written in Perl that I've used on several occasions) has sent me some
time ago but haven't had the opportunity to test yet.
There are many nice aspects to POE. One is the ability to encapsulate
concerns in such a way that they really are accessible only via
messages. Not pointers to objects, but real messages as per classical
text books on object-orientation. But if you don't want a
multi-process app, then that's also fine. It's most often easy to
adapt a standard module to POE. Take a close look at the POE module
for syslog usage.
Another nice aspect is to have an internal communication channel
(POE's own) while maintaining external (TCP, serial) communications.
All POE modules can communicate between themselves in such a manner.
And although I haven't tried it yet, several distinct POE apps can
exchange msgs between themselves using inter-kernel communications
(IKC).
I'm currently having some kind of framework going. Basically I'm
going towards the definition of an API that facilitates user
interfaces and application while isolating proper processing. Nothing
fancy. A main POE session launches other POE modules for network
comms, UI interface, and each of these modules communicate using a
well-defined, hopefully common, API. All data is sent back to the
main app for processing and in turn the main app is using custom-made
plain Perl modules to do this. The goal is to have an easy to
implment framework that can adapt itself to various jobs, be them on a
intranet (communicating with a NMS) or internet.
In one word, POE is fun. When I discovered Perl a few years ago I was
pleasantly surprised by the language. When I discovered POE on top of
that, then it was delight.
Cheers.
Al
More information about the toronto-pm
mailing list