Stream Question

Ned Konz ned at bike-nomad.com
Wed Sep 19 18:07:34 UTC 2001


On Wednesday 19 September 2001 10:02 am, Ken G. Brown wrote:
> I am reading continuous input from a serial port, displaying on several
> transcripts depending on embedded tokens. By the way everyone, Thx to all
> the help I have the first try at this stuff working now!

Good to hear!

> I have a process monitoring the port, writing to a stream, and via
> WorldState addDeferredMessage: I'm splitting the stream and displaying to
> multiple TranscriptsStream windows. For now I've saved the write position,
> restored the previous saved read position for the current output, then on
> exit restored the write position again. 

That's overkill for TranscriptStream. See below.

> I need to be able to run for days
> so do not want streams doubling their size when they reach the end.

Transcripts don't do this (see TranscriptStream>>pastEndPut:). They just 
flush what they've got; their views truncate to 20K max.

> Ned's circular buffer sounds like what I need to do.

You're welcome to it, but you should be able to use the Transcripts.

> I also will look into the
> possibility of creating a second read stream on the first write stream,
> that sounds like it would be helpful. Did not know you could do that.

You can have multiple streams on the same collection, but you can't create a 
stream on a stream.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list