in reply to Piping Tail and while loops

I just did something very similar and tried out a couple different strategies before I came upon something i was happy with. It's all shown in gory detail in this recent thread: blocking, non-blocking, and semi-blocking