Hi Nicholas,

Thanks for the reply, I was using 1 single session, but then thought
the reason the delay time wasn't working was because it was all set in
the same session.

Basically the file is created with a list of networks in it, the
script then deletes it once it has read them all in. The idea is that
"someone" drops a file into the directory, the script reads it and
schedules the rbl lookups on the networks in the file, the results are
then written to a file somewhere else (yet to be coded).

I was initially using delay, but again tried alarm_set to see if that
worked instead, it didn't and I didn't change it back.

I'm still fairly confused because having spoken to the nice ppl in
#poe on irc.perl.org I've been told that it should work as I'm
expecting.... but its not :(

Thanks for looking :)

--
Peter Farmer

On 08/06/06, Nicholas Perez <[EMAIL PROTECTED]> wrote:
Hi Peter,

I don't think I would organize this the way it's been done. You are
basically providing the same code refs to two different sessions for
starters. This could easily be done with a single session and using
something like POE::Wheel::FollowTail, so that anytime there is new
input appended to the file, your events would get called. I don't know
how your input file gets generated, but I assume it is just a log file
that keeps growing if the file remains existent.

If you are set on doing it this way, I would aggregate your two
sessions into one. No real need to have two sessions. Also, your email
mentions one way of delayed events and your code uses another. Which
one are you using? I am not exactly sure alarm_set over and over again
is what you want to do. See POE::Kernel.

Just some things to think about.

On 6/8/06, Peter Farmer <[EMAIL PROTECTED]> wrote:
> On 08/06/06, Peter Farmer <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I'm fairly new to coding with POE, and I think I've not quite grasped
> > the concepts correctly.
> >
> > I have a script which has two sessions, the first session is what I
> > call a scheduler session, basically it reads the content of a txt file
> > and "schedules" events into the other session with
> >
> > $kernel->post("worker","job_runner",$arg);
> >
> > the scheduler session then runs a
> >
> > $kernel->delay_set("scheduler", 10);
> >
> > What I'm expecting to happen is that the worker session chugs through
> > the events its been posted, but after 10 seconds the scheduler session
> > runs again to check the content of txt file and post more events to
> > the worker if needed. Basically what happens is that the worker
> > session chugs through it entire queue and then the scheduler runs
> > again.
> >
> > Is there a way to get what I want to happen to happen?
> >
> >
> >
> > Thanks,
> >
> > --
> > Peter Farmer
> >
>
> Hi again,
>
> pastebins of the code:
>
> http://poundperl.pastebin.com/767423
> http://poundperl.pastebin.com/767424
>
>

Reply via email to