shut down on EOF when queues are empty.