use end-of-stream module to handle all stream end events - needs more tests, see orchestrator