SimpleTee flush

Поиск
Список
Период
Сортировка
Искать

SimpleTee flush

От:
Kevin Grittner <kgrittn@ymail.com>
Дата:
Вложения:
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

Re: SimpleTee flush

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Kevin Grittner  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

От:
Kevin Grittner <kgrittn@ymail.com>
Дата:
Tom Lane  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

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Kevin Grittner  writes:
> Tom Lane  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

От:
Kevin Grittner <kgrittn@ymail.com>
Дата:
Kevin Grittner  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


FAQ