Levente, On 08 Dec 2010, at 13:03, Levente Uzonyi wrote:
I don't get how #streamContents: could be used to send #flush. That's a method of SequenceableCollection IIRC.
Yeah, you're right: I stand corrected, this is not related. I tried adding an #on:do: modeled after #fileNamed:do: to ensure that #flush is called, which is more elegant IMHO: [ FileStream fileNamed: '/tmp/numbers.txt' do: [ :fileStream | ZnBufferedWriteStream on: fileStream do: [ :bufferedStream | 100000 timesRepeat: [ bufferedStream print: 100 atRandom; space ] ] ] ] timeToRun.
SocketStream is unrelated here, because it doesn't write to files and buffering was always implemented in it AFAIK.
I think it is relevant: it proves that people can perfectly live with output buffering. Can you give an example of which code would break (so needs to call #flush) with output buffering ? Would there be many cases ? Sven