Re: Pattern for converting procedures to events

2002-05-23 Thread Rocco Caputo
On Thu, May 23, 2002 at 09:16:44PM -0400, Peter Chen wrote: > I am working on a tutorial explaining how to poeize a procedural > program, in the hope of making it easier for my coworkers to pick up > POE. > > Since I have not worked with POE for that long, I am wondering whether > there is an easi

Re: best practices for handling responses/postbacks

2002-05-23 Thread Rocco Caputo
On Thu, May 23, 2002 at 03:31:43PM -0400, Peter Chen wrote: > I would like to solicit your insight on the best practices in handling > responses/postbacks. Specifically, I am wondering what are the pro's > and con's of using a response event vs. a response postback. For > example, [simple post

Re: Pattern for converting procedures to events

2002-05-23 Thread Matt Cashner
On (05/23/02 21:16), Peter Chen wrote: > I am working on a tutorial explaining how to poeize a procedural > program, in the hope of making it easier for my coworkers to pick up > POE. when you get done with this, would you be agreeable to it being included in poed? (poed is the languishing pro

Pattern for converting procedures to events

2002-05-23 Thread Peter Chen
I am working on a tutorial explaining how to poeize a procedural program, in the hope of making it easier for my coworkers to pick up POE. Since I have not worked with POE for that long, I am wondering whether there is an easier and more elegant way of doing this. This is what I have so far, s

Re: best practices for handling responses/postbacks

2002-05-23 Thread Kirill
> A couple advantages of using postbacks that I can think of are > > 1. The ability to include state arguments. > 2. More generalized, i.e., it works with functions outside of POE. 3. They hold a reference to your object and so help it stay in memory. IIRC that was the reason postbacks were chos

best practices for handling responses/postbacks

2002-05-23 Thread Peter Chen
I would like to solicit your insight on the best practices in handling responses/postbacks. Specifically, I am wondering what are the pro's and con's of using a response event vs. a response postback. For example, $kernel->post($worker_session, $work_request_event, $work_respo

Re: Recognizing end of file on POE::Wheel::Run

2002-05-23 Thread Peter Chen
On Thu, 2002-05-23 at 14:15, Rocco Caputo wrote: > It is slightly inaccurate. > > CloseEvent indicates when the child process has closed its STDOUT and > STDERR handles. STDIN may still be available for input. Thank you for the clarification. I see my misunderstanding regarding how STDIN

Re: Recognizing end of file on POE::Wheel::Run

2002-05-23 Thread Rocco Caputo
On Thu, May 23, 2002 at 10:39:46AM -0400, Peter Chen wrote: > On Thu, 2002-05-23 at 09:29, Rocco Caputo wrote: > > On Mon, Jan 21, 2002 at 02:28:50PM -0700, Chris Fedde wrote: > > > > > > I've fantasized about two interfaces. First would be to put the > > > string 'STDIN' or 'STDERR' (or descrip

Re: Recognizing end of file on POE::Wheel::Run

2002-05-23 Thread Peter Chen
On Thu, 2002-05-23 at 09:29, Rocco Caputo wrote: > On Mon, Jan 21, 2002 at 02:28:50PM -0700, Chris Fedde wrote: > > > > I've fantasized about two interfaces. First would be to put the > > string 'STDIN' or 'STDERR' (or descriptors 1 or 2) in ARGV4 and > > assume the user knows that '$_[ARGV1] eq

Re: POE::Wheel::Run EOF again

2002-05-23 Thread Peter Chen
On Wed, 2002-05-22 at 18:41, Rocco Caputo wrote: > Do you specifically need to know when STDOUT is closed, or is it more > important to know that the child is done sending information at all? The later would be sufficient, even though it would be nice to have finer grain control. For example, I

Re: Recognizing end of file on POE::Wheel::Run

2002-05-23 Thread Rocco Caputo
On Mon, Jan 21, 2002 at 02:28:50PM -0700, Chris Fedde wrote: > > I've fantasized about two interfaces. First would be to put the > string 'STDIN' or 'STDERR' (or descriptors 1 or 2) in ARGV4 and > assume the user knows that '$_[ARGV1] eq 'read' and $_[ARGV3]==0' is an > EOF on a non blocking fil

Re: POE::Wheel::ReadWrite questions

2002-05-23 Thread George Chung
problem solved. POE::Wheel::ReadWrite->new should be put in _start event. George "George Chung" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I want the following code to read and write from STDIN and to STDOUT. > It's supposed to work if I type "echo test|.