first pass at thread-safe, but multithreaded streaming function