sprog-commit Mailing List for Sprog
Status: Alpha
Brought to you by:
grantm
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|
From: <gr...@us...> - 2008-09-20 23:03:19
|
Revision: 798 http://sprog.svn.sourceforge.net/sprog/?rev=798&view=rev Author: grantm Date: 2008-09-20 23:03:11 +0000 (Sat, 20 Sep 2008) Log Message: ----------- fix for buffering problem reading from filehandle Modified Paths: -------------- modules/sprog/trunk/lib/Sprog/GlibEventLoop.pm modules/sprog/trunk/lib/Sprog/Mixin/InputFromFH.pm Modified: modules/sprog/trunk/lib/Sprog/GlibEventLoop.pm =================================================================== --- modules/sprog/trunk/lib/Sprog/GlibEventLoop.pm 2008-08-21 10:11:19 UTC (rev 797) +++ modules/sprog/trunk/lib/Sprog/GlibEventLoop.pm 2008-09-20 23:03:11 UTC (rev 798) @@ -2,6 +2,7 @@ use Glib (); +use IO::Handle (); my $loop; @@ -28,6 +29,7 @@ sub add_io_reader { my($class, $fh, $sub) = @_; + $fh->blocking(0); return Glib::IO->add_watch(fileno($fh), ['in', 'err', 'hup'], $sub); } @@ -35,6 +37,7 @@ sub add_io_writer { my($class, $fh, $sub) = @_; + $fh->blocking(0); return Glib::IO->add_watch(fileno($fh), ['out', 'err', 'hup'], $sub); } Modified: modules/sprog/trunk/lib/Sprog/Mixin/InputFromFH.pm =================================================================== --- modules/sprog/trunk/lib/Sprog/Mixin/InputFromFH.pm 2008-08-21 10:11:19 UTC (rev 797) +++ modules/sprog/trunk/lib/Sprog/Mixin/InputFromFH.pm 2008-09-20 23:03:11 UTC (rev 798) @@ -25,11 +25,11 @@ delete $self->{in_tag}; my $buf; my $fh = $self->fh_in; - if(sysread($fh, $buf, BUF_SIZE)) { + while(sysread($fh, $buf, BUF_SIZE)) { $DBG && $DBG->(ref($self) . ' read ' . length($buf) . ' bytes'); $self->msg_out(data => $buf); } - else { + if(eof($fh)) { $DBG && $DBG->(ref($self) . ' EOF'); close($fh) if $fh; $self->fh_in(undef); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gr...@us...> - 2008-08-21 10:11:22
|
Revision: 797 http://sprog.svn.sourceforge.net/sprog/?rev=797&view=rev Author: grantm Date: 2008-08-21 10:11:19 +0000 (Thu, 21 Aug 2008) Log Message: ----------- add missing description of list gears Modified Paths: -------------- modules/sprog/trunk/lib/Sprog/help/connectors.pod Modified: modules/sprog/trunk/lib/Sprog/help/connectors.pod =================================================================== --- modules/sprog/trunk/lib/Sprog/help/connectors.pod 2006-07-28 20:50:23 UTC (rev 796) +++ modules/sprog/trunk/lib/Sprog/help/connectors.pod 2008-08-21 10:11:19 UTC (rev 797) @@ -6,7 +6,7 @@ You can only connect two gears together if the output connector of the first gear matches the input connector of the second. -There are currently two types of connector: +There are currently three types of connector: =head2 Pipe Connectors @@ -17,8 +17,14 @@ =head2 Record Connectors The record connector is used to pass structured data as a sequences of records. -Each record is a Perl hash. +Each record is a Perl hash (i.e.: fields are name => value pairs). Generally if a gear has a record output connector, the help page for the gear will list what keys you can expect to find in each record hash. +=head2 List Connectors + +The list connector is similar to a record connector but each record is a Perl +array rather than a hash (i.e.: a record is a list of field values, the record +does not include field names). + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |