use signal channel to trigger flushing