stream within a thread