Moved invoke_when_ready to a detail namespace