Thanks for the response. Yes I was considering the idea of an alarm delivery system.
You said: > Knowing only this about your project, I would use UT::Event::<type> > after UT::Session determined the type the client was requesting. To > get "use" working at runtime, I'd either string eval it or block eval > a require and import. Would it not be more efficeint to require them at the root level, i.e. UT::Shell. Then ask the Shell to pass references to the new UT::Event::<type>'s as UT::Session(s) need them? Or am I missing something... If one session require()s something, then another session re-require()s it, does it get 'reloaded' or what? I have to be consious about speed. > Making UT::Session data driven may help, but I don't know enough about > it to say for sure. What do you mean by data driven? -----Original Message----- From: Rocco Caputo [mailto:[EMAIL PROTECTED]] Sent: Monday, December 10, 2001 6:49 PM To: [EMAIL PROTECTED] Subject: Re: POE Objects On Mon, Dec 10, 2001 at 02:05:11PM +0100, Jotham Read wrote: > Hello, [...] > Now, I have some problems with this. First of all it seems a bit to much > like a 'jungle of objects'. Below are my specific questions. > > I am not sure when I should tell perl to 'use UT::Event::<type>;' (In > UT::Session?). The point of making these things objects was to reduce the > size of UT::Session. Knowing only this about your project, I would use UT::Event::<type> after UT::Session determined the type the client was requesting. To get "use" working at runtime, I'd either string eval it or block eval a require and import. Making UT::Session data driven may help, but I don't know enough about it to say for sure. > I do not know of a nice way to allow the UT::Event::<type> objects to use > the POE alarms and delays. Would they need their own alarms and delays, or do you plan to set them in the UT::Session instance that created them? I can suggest two solutions to the former problem: 1. Have each UT::Session hold its own internal POE::Session for private timers. 2. Create a "service" component that holds timers on behalf of UT::Event instances. The service would deliver timers with plain callbacks. As for the latter, you can use $poe_kernel (exported by POE::Kernel) to access alarm() and delay() for the parent POE::Session. sub some_library_function { $poe_kernel->delay( event_for_calling_session => 60 ); } [...] -- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sourceforge.net -------------------------------------- Internet E-mail Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of my firm shall be understood as neither given nor endorsed by it. --------------------------------------
