Thread: SimpleTee flush

SimpleTee flush

From
Kevin Grittner
Date:
I find the TestLib.pm framework to be more friendly with the
attached tweak to SimpleTee.pm.  It's not a big deal, so if anyone
objects I'll let it drop, and I don't think it merits anything
fancier.

Objections?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment

Re: SimpleTee flush

From
Tom Lane
Date:
Kevin Grittner <kgrittn@ymail.com> writes:
> I find the TestLib.pm framework to be more friendly with the
> attached tweak to SimpleTee.pm.  It's not a big deal, so if anyone
> objects I'll let it drop, and I don't think it merits anything
> fancier.

Just out of curiosity --- what's the rationale for flushing after
every line, rather than once at the end of the loop?  Is there
actual input-reading going on underneath the @$self notation?
If it's just dumping data from process memory, I should think
one flush would be sufficient.
        regards, tom lane



Re: SimpleTee flush

From
Kevin Grittner
Date:
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Just out of curiosity --- what's the rationale for flushing after
> every line, rather than once at the end of the loop?  Is there
> actual input-reading going on underneath the @$self notation?
> If it's just dumping data from process memory, I should think
> one flush would be sufficient.

Isn't the loop over file handles written to?  What would you flush
outside the loop?


--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: SimpleTee flush

From
Tom Lane
Date:
Kevin Grittner <kgrittn@ymail.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Just out of curiosity --- what's the rationale for flushing after
>> every line, rather than once at the end of the loop?

> Isn't the loop over file handles written to?

Oh... I just automatically read it as looping over some data,
not printing the same data to multiple filehandles.  That's kind of
odd ... but yeah, you would have to do it like that.
        regards, tom lane



Re: SimpleTee flush

From
Kevin Grittner
Date:
Kevin Grittner <kgrittn@ymail.com> wrote:

> I find the TestLib.pm framework to be more friendly with the
> attached tweak to SimpleTee.pm.

Pushed.

Please ignore the typo in the commit message -- I was looking right
at the code saying "autoflush", but what came off my fingers (from
muscle memory?) was "autocommit".  :-/

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company