Aside from a recent one where there was a short warning, 90%+ of the time they give you a 90-minute warning that the update is coming. You should be able to finish whatever content you were doing in that time, if not then leave at that time so you don't waste the energy and get cut off at the last second. No need for them to code this in just because some people are too impatient to wait until after an update to complete a time consuming task.
The only thing I hope for is that they completely stop doing the almost no-warning reboots, although rare.