ntpq needs a push after each line

Eric S. Raymond esr at thyrsus.com
Mon Nov 7 23:03:06 UTC 2016

Hal Murray <hmurray at megapathdsl.net>:
> > I can flush() each peer spreadsheet line; is that the main issue?
> I think that would be fine.
> There are probably a zillion other places that also write lines.  They may 
> not matter unless it is slow to write the next line.  I can think of two 
> reasons for a line to be slow.  One is collecting data from the target 
> server.  The other is doing a DNS lookup to print out a name rather than an 
> IP Address.

In ntpq it turns out there was an easy way to handle this.  I wrote its code to
do output through a method in the command-interpreter class named "say" which
called sys.stdout.write.  Adding sys.stdout.flush() after the write should
have solved your problem.

Score one for correct factoring.
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

More information about the devel mailing list