Re: Porting POE to Moose
Ah... somebody send Evan some Syrup of Epicac. I know from alot of the JaaaVVaa programmers I have to deal with... Everything is an object to them. Well, not everything is an Object. I actually like State machines BETTER.? So think of each POE session as a state machine.? Look at a Moore or Mealy model.? Both work well in POE. I think that Moose ing POE may be akin to putting a Briggs and Stratton motor in a Top Fuel Dragster! (Somethin is wrong with this picture!) Dougie!!! -Original Message- From: Evan Carroll To: poe@perl.org Sent: Mon, 27 Apr 2009 4:53 pm Subject: Porting POE to Moose Dear POE, I'm sick of pulling my hair out because of your 1989 coding practice. I've begun packing your bags to send you to Moose-landville. My goal is to totally deprive you of blessed arrays, and closures in new. I personal yearn for the day when you lack the confusing nonsense that gives you your identity. The problem is other modules don't look like you for a reason -- you're ugly. You're actually worse than ugly, you're hideous. You're the ugly bastard brother of the ugly duck. While you aver that smaller, more modular functions are better for an event driven systems, at your core you're black with deception. You have the longest most ugly and hard to follow monolithic logic ever. But, wait I think I'm playing this down... See, you're more than just one type of ugly: you've actually got all the unique colors of ugly; but, unlike a rainbow they're are in no predictable order. That's right, your capriciously ugly. Above and beyond blessed arrays, why for the love of god do you feel the need to strive for object-orientation through "components." What is a component anyway?!? Why can't I just go my POE->new( kernel_args )->wheel( wheel_args )->add_to_wheel( new_event ). Why do I have to read to just figure out your obscure coding methodology? Why can't you just be like everyone else. How do your individual components talk to each other, why is it so hard to figure out what your doing when you fail to do what I want? You act like Perl's objects are an unfit for life, but in the end my code just looks like a soup of disassociated components that sometimes work, and sometimes don't. Why is it so hard to publish a module that attaches to the POE Kernel if it is there, and if it isn't operates in a sane fashion... Join me in slaying the dragon: http://github.com/EvanCarroll/MooseyPoopoe/ (All of the POE::Kernel::Filters are migrated and running under the test suite) -- Evan Carroll System Lord of the Internets
Re: POE and perl fork interaction
Deven, Take a look at the Cookbook and the job control examples. While a poe kernel is a process singleton, you can have many sessions running on the same kernel. Dougie!!! -Original Message- From: Deven Parekh To: douglasstv...@aol.com Cc: robert.land...@corp.aol.com; poe@perl.org Sent: Thu, 15 Jan 2009 10:35 am Subject: Re: POE and perl fork interaction Hello Rob, Dougie, Thanks for the suggestion. I apologize for not being clear on what i am trying to achieve. Basically I have built a wrapper module around POE to handle certain tasks. This allows the user of the wrapper module to be ignorant about POE. Each task has its own wrapper module and interface. examples of task is - tailig of files, has its own set of wrapper module - placing a test VOIP call to VOIP server under test, has its own set of wrapper module - verifying contents in tailed files, has it own set of wrapper module I want each of these to be independent POE wrappers and an independent way to start/stop each of the task. I have POE::Kernel->run per set of wrapper modules that starts of the task. I tried to create a set of wrapper module for the file tailing using POE::Component::IKC POE::Wheel::FollowTail (i wanted to tail files on remote machines, so also looked at POE::Componenet::RemoteTail) POE::Wheel::Run But since POE::Kernel is a singleton per process when i have a script that is trying to launch multiple task (implying multiple sets of wrappers) there is lot of interaction and the kernels don't seem to stop since (I am assuming the kernel resources/state get all mixed up due to the way i have it coded). But both your comments about "...start another kernel on that process" and "POE::Wheel::Run ... Nested POE Kernels" seem to be interesting. i will explore that option. Any additional pointers to these topics? In the mean time if you have suggestion on how i can achieve the above i will aprreciate it. I know it is difficult to provide input based just on pure white-paper text as above instead of looking at code samples and ruuning example outputs. Regards Deven. p.s: For my problem of using perl's fork and POE in the same script I turned on some debugging on POE::Kernel and observed that there may be some interaction with handling the "CHLD" signal. All the sessions in POE::Kernel terminate succesfully and there are no resources in use, except the POE::Kernel seems to some how wait for the forked child (that happen outside of POE::Kernel) to finish. Once those forked child process are done (killed) the POE::Kernel seems to retrun. I am not sure how/why POE::Kernel gets a signal handler registered to keep waiting for process forked outside of it. I had forked those process before running the POE::Kernel. On Wed, Jan 14, 2009 at 11:40 AM, wrote: > > This got me to thinking > > Setup a POE::Wheel::Followtail for each file you want to tail. No need > to spawn off other processes. > > If you DO need separate processes, from the main process run a > POE::Wheel::Run and start another kernel on that process. Setup a > Followtail wheel for the input and handle the output back to the Main code > via STDOUT and the Run object. > > I tend to use fork sparingly and if you need to do alot of things > simultaneously, you should probably handle those in POE first. > > HTH, > > Dougie!!! > > -Original Message- > From: Robert Landrum > To: Deven Parekh > Cc: poe@perl.org > Sent: Tue, 13 Jan 2009 6:51 pm > Subject: Re: POE and perl fork interaction > > It's not clear what you're trying to do, but I suspect that you're doing it > wrong. :( > > Is there a reason why you don't use POE::Wheel::Run to tail the files? > > There's also: > > http://search.cpan.org/~rcaputo/POE-1.003/lib/POE/Wheel/FollowTail.pm > > I suspect that your forked tail process may have events queued from the > parent, as outlined in POE::Wheel::Run section on Nested POE Kernels. > > Good luck. > > Rob > > Deven Parekh wrote: > > Hello, > > > > Is it possible to use POE and the fork function in the same script. > > I am running into an interaction problem where the POE::Kernel does not > > return if i have forked off other process outside of the POE. Any input > on > > what I may be doing wrong > > > > Here is the psuedo code logic of my script > > > > #--- Call a function to fork off a process to start tailing some files > > #--- store its the above pids so we can terminate later > > > > #--- Call POE::Wheel::Run to do some task > > > > #--- After the above POE task returns kill the tailing process > > > > > > If i do not do the forking for tailing files, the POE::Kernel returns > after > > the > > task is completed, but if I fork of the tailing process as above, > > the POE::Kernel never returns. > > > > Any input will be appreciated. > > > > Thanks in advance. > > > > BR > > DP > > p.s: I thought i had read about this interaction somewhere in > documentation > > bu
Re: POE and perl fork interaction
This got me to thinking Setup a POE::Wheel::Followtail for each? file you want to tail.? No need to spawn off other processes. If you DO need separate processes, from the main process run a POE::Wheel::Run and start another kernel on that process.? Setup a Followtail wheel for the input and handle the output back to the Main code via STDOUT and the Run object. I tend to use fork sparingly and if you need to do alot of things simultaneously, you should probably handle those in POE first. HTH, Dougie!!! -Original Message- From: Robert Landrum To: Deven Parekh Cc: poe@perl.org Sent: Tue, 13 Jan 2009 6:51 pm Subject: Re: POE and perl fork interaction It's not clear what you're trying to do, but I suspect that you're doing it wrong. :(? ? Is there a reason why you don't use POE::Wheel::Run to tail the files?? ? There's also:? ? http://search.cpan.org/~rcaputo/POE-1.003/lib/POE/Wheel/FollowTail.pm? ? I suspect that your forked tail process may have events queued from the parent, as outlined in POE::Wheel::Run section on Nested POE Kernels.? ? Good luck.? ? Rob? ? Deven Parekh wrote:? > Hello,? >? > Is it possible to use POE and the fork function in the same script.? > I am running into an interaction problem where the POE::Kernel does not? > return if i have forked off other process outside of the POE. Any input on? > what I may be doing wrong? >? > Here is the psuedo code logic of my script? >? > #--- Call a function to fork off a process to start tailing some files? > #--- store its the above pids so we can terminate later? >? > #--- Call POE::Wheel::Run to do some task? >? > #--- After the above POE task returns kill the tailing process? >? >? > If i do not do the forking for tailing files, the POE::Kernel returns after? > the? > task is completed, but if I fork of the tailing process as above,? > the POE::Kernel never returns.? >? > Any input will be appreciated.? >? > Thanks in advance.? >? > BR? > DP? > p.s: I thought i had read about this interaction somewhere in documentation? > but am not? > able toget to it to follow discussion around it, if any.? >? > ?
Re: Porba? Poe-rba?
In a message dated 5/9/04 12:06:01 PM Eastern Daylight Time, [EMAIL PROTECTED] writes: On Tue, Mar 23, 2004 at 03:13:14PM -0800, Carter II, Jimmy S. wrote: > > Glory to POE! All Hail POE! (etc etc) > > As I work with POE, I find myself thinking of event data as messages, > which leads to weird thoughts about ORBs and CORBA. Has there every been > a discussion of extending POE just a tad further and making a standard > interface for a distributed framework? Is it on CPAN and did I miss it? There's POE::Component::IKC. It's not CORBA, but it does provide a publish/subscribe model for POE. -- Rocco Caputo Hm... CORBA? While I like portions of CORBA and OMF, the IDL-GDMO end of things makes CORBA a beast to say the least. In all actuality, wouldn't an IRC Server function effectively as a publish and subscribe model? Yet this is much simpler and much more flexible when you think about it. Using SOAP Services is another way to do P-S especially if you work the WSDL/XML side of things. I'm still interested to see if POE could be ORBed... Or maybe, CORBA could be POEized! Dougie!!!
Re: AIM/OSCAR Component?
I would love to see a copy of this myself... Dougie In a message dated 4/1/2004 5:55:58 PM Eastern Standard Time, [EMAIL PROTECTED] writes: Back in August, Dan McCormick said he had written (and documented!) POE::Component::Net::OSCAR. There's call for such a beast if it still exists. Has anyone seen it lately? -- Rocco Caputo
Fwd: soap server
In a message dated 11/3/2003 1:42:53 PM Eastern Standard Time, DouglasStvnsn writes: I have a tcp oriented service that I have done with a DBI type backend thingy in a run wheel... My problem with the SOAP wasn't so much the SOAP stuff but the type of data I was attempting to SOAPify... My data is like a grep of a pattern on a file or a tail -f of a file... I push a line back to the client as each line is received. With POE + SocketFactory and Run wheels to handle the elements that could take some time, it works fine. In SOAP, however, this does not work. SOAP is actually an XML based "Envelope" of XML Data transferred via HTTP. Within an Envelope, you expect what you send to be ALL of the data in a letter. However, if you're grepping a 2GB file, it may contain several hundred lines that match the grep string. In the case of SOAP, you load this into memory (Which could get H U G E! especially if some user greps on *!!!...) Plus, if I lag output as part of waiting on ALL of the data to be retrieved, then my users will not use it. The POE::Component::Server::SOAP function does maintain state of each request. This is done via @_[ARG0] where it passes a reference to the transaction. From there, you can get the parameters... Look at the sub do_sum in the doco at http://search.cpan.org/~rcaputo/POE-Component-Server-SOAP-0.03/SOAP.pm Also, take a look at POE::Component::LaDBI... SOAP and Security? Ha! SOAP is inherently insecure... But it can be secured IF you secure it via HTTPD. I've heard XMLRPC is more secureable but haven't explored this Dougie!!! In a message dated 11/3/2003 9:37:09 AM Eastern Standard Time, [EMAIL PROTECTED] writes: HiHaving lurked on this list (when time permits) for a while, I'm still not sure for what range of applications Poe should be the right choice.Right now I'm looking at writing a soap server as a backend to an embperl application. SOAP::Lite includes an example for using HTTP::Daemon, which looks simple.I've seen soap mentioned with Poe as well.Why would I want to use Poe over HTTP::Daemon and vice-verse ?If I add this information- The soapserver will talk to a PostgreSQL database.- I'm not sure how to handle the database connection. No need for a new handle for each new request, but handles expire after some time of inactivity.- I'd like the server to do its own maintenance. Once in a while it could remove old sessions or do other tricks like time-based business methods.- It will perform a lot of methods from a lot of business modules.- Can a Poe-server hold the state over several requests ? I guess the answer is yes, but do examples exist ?- How about security. I suppose that ssl is no problem ?- Authenticity - the server has to know who's requesting the service and see if they'r allowed to do so.-- Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582Kaki Data tshirts, merchandize Fax: 3816 2501Howitzvej 75 Åben 12.00-18.00 Email: [EMAIL PROTECTED]2000 Frederiksberg Lørdag 12.00-16.00 Web: www.suse.dk --- Begin Message --- I have a tcp oriented service that I have done with a DBI type backend thingy in a run wheel... My problem with the SOAP wasn't so much the SOAP stuff but the type of data I was attempting to SOAPify... My data is like a grep of a pattern on a file or a tail -f of a file... I push a line back to the client as each line is received. With POE + SocketFactory and Run wheels to handle the elements that could take some time, it works fine. In SOAP, however, this does not work. SOAP is actually an XML based "Envelope" of XML Data transferred via HTTP. Within an Envelope, you expect what you send to be ALL of the data in a letter. However, if you're grepping a 2GB file, it may contain several hundred lines that match the grep string. In the case of SOAP, you load this into memory (Which could get H U G E! especially if some user greps on *!!!...) Plus, if I lag output as part of waiting on ALL of the data to be retrieved, then my users will not use it. The POE::Component::Server::SOAP function does maintain state of each request. This is done via @_[ARG0] where it passes a reference to the transaction. From there, you can get the parameters... Look at the sub do_sum in the doco at http://search.cpan.org/~rcaputo/POE-Component-Server-SOAP-0.03/SOAP.pm Also, take a look at POE::Component::LaDBI... SOAP and Security? Ha! SOAP is inherently insecure... But it can be secured IF you secure it via HTTPD. I've heard XMLRPC is more secureable but haven't explored this Dougie!!! In a message dated 11/3/2003 9:37:09 AM Eastern Standard Time, [EMAIL PROTECTED] writes: HiHaving lurked on this list (when time permits) for a while, I'm still not sure for what range of applications Poe should be the right choi
Re: Grandwheels or wheel-wheels question
Markus, Take a look at POE::Wheel::Run. Run can be initiated as spawning a separate program or subroutine. Use a ReadWrite wheel to connect the subprocess back to the Run Wheel. In the subroutine or separate script, run a kernel inside of that to handle the IO, multiwhatevers, etc. Dougie! In a message dated 8/19/03 5:10:39 PM Eastern Daylight Time, [EMAIL PROTECTED] writes: Hi, I have a program where I need to execute some longish tasks in parallel. So far I have understood that POE is some first class choice, and that the way to go is to have some POE::Filter::Reference wheels spawned off. However, these wheels have to deal with collecting the longish data itself. Recently, I learned that this may be some n GBytes each, so backquotes or even file redirection could turn out improper. I would like to employ POE also - does anybody have experience with wheel processes (children) creating one or more wheels again? Of course I could "fold" the output handling into one hierarchy, but this would make a line oriented processing problematic, and a load oriented job spawning quite hard. Any help is appreciated. Best regards, Markus -- Markus Jansen Senior IS/IT Support Engineer, EED/IT Ericsson Eurolab Deutschland GmbH Email : [EMAIL PROTECTED] Ericsson Allee 1 Phone : +49 2407 575 5157 52134 Herzogenrath Fax : +49 2407 575 7289 GermanyMobile: +49 172 274 2003
Re: IP-Addr. of connecting clients (to be able reject)
Carl, In the handler for the SuccessEvent coming from your SocketFactory... For your Reference: Socket_Handle = @_[ARG0]; IADDR = @_[ARG1]; Remote_Port= @_[ARG2]; SocketFactoryID = @_[ARG3]; You'll need to unpack the IP Address using: $Remote_Address = inet_ntoa($IADDR); HTH, Dougie! In a message dated 7/24/03 7:23:18 AM Eastern Daylight Time, [EMAIL PROTECTED] writes: Hi, it's the first time that I've used POE (based on its chat-server) to realize a Socket-based program that sends from a 'studio' to all listening clients the same data (lines). That works so far, but now I'd like the server to know which ip-addr are allowed to conntect and which are to reject. Please give me a hint how can I get th IP-Addr. of the connecting client in this function (of the chat-server): sub client_connected { my $session_id = $_[SESSION]->ID; $users{$session_id} = 1; broadcast( \%studio, $session_id, "1 Client connected." ); } Thanks, Carl