we need to flush the `callback_queue` in here so callers are guaranteed that their callback will be executed