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


Thanks,

--
Peter Farmer

Reply via email to