Hello!

I just discovered POE while researching on a project I'm about to embark on
at work. So I'm new with POE, but a long time Perl programmer. I've read
through most of the documentation and tutorial, and now I'm trying to
decide what approach to take.

In a nutshell, here's what my program is supposed to do:

0. Log in to an IRC server, at a specified channel.

1. Get some data from our web service that has REST interface. But we
already have a Perl module that wraps the REST calls so I don't have to
make the REST calls directly. This perl module is using LWP.

2. For each of the data returned from #1, post it to an IRC channel.

3. Wait for some predetermined time (say 60 secs?) and go back to #1.

The data is retrieved through some filter, so there's not going to be a lot
of data that will come back.

The program has to be "mission critical" as much as possible, that is, it
has to rejoin the channel if kicked out, or reconnect to the server if
disconnected.

Here are some of my ideas how I'm going to do it, in order of preference:

1. Use POE::Component::IRC to create a bot, and create a recurring alarm
handler in the tick event. During the tick event is when I retrieve data
from our web app, and send the messages to the channel. I'm going to use
the recurring alarm cookbook example in case this will take a while.

2. Create two separate sessions similar to the "Combined Services" cookbook
example.

3. Create it from a base POE and create the POE::Sessions myself (instead
of using the POE::Component::IRC) to handle all the IRC events and second
POE::Sessions to handle the web app query.

By going with #1 it will save me a lot of time in handling the IRC events,
reconnection, etc. But being a noob with POE, I'm wondering if there's some
potential problem I'd run into.

Or is there a better way aside from what I'm thinking?

Thanks in advance.

Celso

Reply via email to