POE Application fault tolerance

2006-07-27 Thread Peter Farmer

Hi all,

I'm trying to write my application with as much fault tolerance as
possible, with that is mind, is if acceptable for a sessions _start
subroutine to call:

$kernel-delay_set(_start, 60);

obviously the _start subroutine will have some logic to prevent it
from running any of the work subroutines.

The basic idea is that if _start can't initialise the session because
a database connection fails (for example), it can try again after a
set period of time, and 1. it doesn't stop the kernel, and 2. it
doesn't stop other sessions from running etc


Thanks,
--
Peter Farmer


Re: POE not doing what I'm expecting it to......

2006-06-09 Thread Peter Farmer

Thanks to everyone who took the time to reply, I now have a much
better understanding of how to write POE applications.



Thanks,

--
Peter Farmer


POE not doing what I'm expecting it to......

2006-06-08 Thread Peter Farmer

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


Re: POE not doing what I'm expecting it to......

2006-06-08 Thread Peter Farmer

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