Skip Menu |

This queue is for tickets about the Wx-Perl-ProcessStream CPAN distribution.

Report information
The Basics
Id: 54962
Status: resolved
Priority: 0/
Queue: Wx-Perl-ProcessStream

People
Owner: Nobody in particular
Requestors: KTHAKORE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Continous STDERR and STDOUT cause Wx App to freeze
In padre if we run while (1) { print 'blah'; warn 'blah' } it will kill the app making it unusable. After some talk with azawawi, http://irclog.perlgeek.de/padre/2010-02-25#i_2031934 He came up with the fix attached to the diff on here. -- work in progress
Subject: patch.diff
diff --git a/lib/Wx/Perl/ProcessStream.pm b/lib/Wx/Perl/ProcessStream.pm index 0289c41..a0d59e6 100644 --- a/lib/Wx/Perl/ProcessStream.pm +++ b/lib/Wx/Perl/ProcessStream.pm @@ -565,6 +565,7 @@ sub Notify { $event->SetLine( $linebuffer ); $event->SetProcess( $process ); $process->__get_handler()->AddPendingEvent($event); + Wx::wxTheApp->Yield(); } @@ -579,6 +580,7 @@ sub Notify { $event->SetLine( $linebuffer ); $event->SetProcess( $process ); $process->__get_handler()->AddPendingEvent($event); + Wx::wxTheApp->Yield(); } }
RT-Send-CC: mdootson [...] cpan.org
Hi, I would not want to call Yield for every line of output - at least not as a fixed default. It would probably break a lot of exisitng code. Version 0.25 is uploaded to CPAN or you can apply attached diff to your local source. The default max line param of 1000 *should* allow you to process other GUI events. i.e. the module updates may, I think, fix your issue without further code changes. You can intelligently handle a continuous output stream using new methods and events EVT_WXP_PROCESS_STREAM_MAXLINES PeekStdOutBuffer SetMaxLines SetDefaultMaxLines You can, if you really want to, get more or less the same effect as your patch by putting Wx::Perl::ProcessStream->SetDefaultMaxLines(1); somewhere in your code. I would suggest, instead, handling the EVT_WXP_PROCESS_STREAM_MAXLINES and checking in the event handler if you want to kill the process because of repeating output. Note that the event only gets called if you get a continuous stream of output exceeding the number of max lines. Hope the changes fix your issue - or at least allow you to handle it. Regards Mark
Subject: pstream25.diff

Message body is not shown because it is too large.