Implement terminate_stream event